New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some support for WPT tests in an Android emulator through WebDriver #21213
Merged
+256
−76
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
780e21c
Fix Python errors in servodriver
SimonSapin 9b80369
Make servodriver wait until the server starts accepting TCP connections
SimonSapin c05d30d
Add --binary-arg support in ./mach test-wpt --product servodriver
SimonSapin 4acdb81
WebDriver timeout settings are not optional.
SimonSapin 48f6e16
Fix a webdriver timeout during server start up
SimonSapin f5ff709
Refactor run_in_headless_android_emulator.py into more functions
SimonSapin 33234af
run_in_headless_android_emulator: add port forwarding for webdriver
SimonSapin d7495a2
run_in_headless_android_emulator: add support for user stylesheets
SimonSapin 94d1acb
run_in_headless_android_emulator: add support for reverse port forwar…
SimonSapin e6eca2b
run_in_headless_android_emulator: add some code comments
SimonSapin f10b474
More Python fixes for servodriver
SimonSapin cdd6460
Don’t reverse-forward port "None"
SimonSapin 230a6da
servodriver: fix setting preferences
SimonSapin 45b710b
Add ./mach test-wpt-android
SimonSapin 2b5bba6
servodriver: increase browser’s init_timeout
SimonSapin File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
Fix Python errors in servodriver
- Loading branch information
commit 780e21c970058ff32b00bffbaa457eb37fd3601f
| @@ -11,8 +11,10 @@ | ||
| TestharnessExecutor, | ||
| strip_server) | ||
| from ..testrunner import Stop | ||
| from ..webdriver_server import wait_for_service | ||
|
|
||
| webdriver = None | ||
| ServoCommandExtensions = None | ||
|
|
||
| here = os.path.join(os.path.split(__file__)[0]) | ||
|
|
||
| @@ -23,6 +25,26 @@ def do_delayed_imports(): | ||
| global webdriver | ||
| import webdriver | ||
|
|
||
| global ServoCommandExtensions | ||
| class ServoCommandExtensions(object): | ||
SimonSapin
Author
Member
|
||
| def __init__(self, session): | ||
| self.session = session | ||
|
|
||
| @webdriver.client.command | ||
| def get_prefs(self, *prefs): | ||
| body = {"prefs": list(prefs)} | ||
| return self.session.send_command("POST", "servo/prefs/get", body) | ||
|
|
||
| @webdriver.client.command | ||
| def set_prefs(self, prefs): | ||
| body = {"prefs": prefs} | ||
| return self.session.send_command("POST", "servo/prefs/set", body) | ||
|
|
||
| @webdriver.client.command | ||
| def reset_prefs(self, *prefs): | ||
| body = {"prefs": list(prefs)} | ||
| return self.session.send_command("POST", "servo/prefs/reset", body) | ||
|
|
||
|
|
||
| class ServoWebDriverProtocol(Protocol): | ||
| def __init__(self, executor, browser, capabilities, **kwargs): | ||
| @@ -35,8 +57,7 @@ def __init__(self, executor, browser, capabilities, **kwargs): | ||
|
|
||
| def connect(self): | ||
| """Connect to browser via WebDriver.""" | ||
| self.session = webdriver.Session(self.host, self.port, | ||
| extension=webdriver.servo.ServoCommandExtensions) | ||
| self.session = webdriver.Session(self.host, self.port, extension=ServoCommandExtensions) | ||
| self.session.start() | ||
|
|
||
| def after_connect(self): | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Why is this inside
do_delayed_imports?