aboutsummaryrefslogtreecommitdiffstats
path: root/etc/ci/performance/gecko_driver.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-02-07 18:59:03 -0800
committerGitHub <noreply@github.com>2017-02-07 18:59:03 -0800
commite9933f36b771e9aad24b7abcac0ae81b49539d35 (patch)
tree20f79794987390267fd5a94256f329b50564d906 /etc/ci/performance/gecko_driver.py
parente2b494b1d08b8929ca7e5ae369304f41af81ace2 (diff)
parent7aa3350d4532e77be011167daeae83eeb5c00525 (diff)
downloadservo-e9933f36b771e9aad24b7abcac0ae81b49539d35.tar.gz
servo-e9933f36b771e9aad24b7abcac0ae81b49539d35.zip
Auto merge of #15067 - shinglyu:stylo-perf-async, r=Manishearth
Added async performance test <!-- Please describe your changes on the following line: --> Add a new way to test arbitrary timing from JavaScript (only for Gecko). This is for Stylo testing. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15067) <!-- Reviewable:end -->
Diffstat (limited to 'etc/ci/performance/gecko_driver.py')
-rw-r--r--etc/ci/performance/gecko_driver.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/etc/ci/performance/gecko_driver.py b/etc/ci/performance/gecko_driver.py
index fe1450d1d1c..8632a1d5f58 100644
--- a/etc/ci/performance/gecko_driver.py
+++ b/etc/ci/performance/gecko_driver.py
@@ -71,7 +71,7 @@ def generate_placeholder(testcase):
return [timings]
-def run_gecko_test(testcase, timeout):
+def run_gecko_test(testcase, timeout, is_async):
with create_gecko_session() as driver:
driver.set_page_load_timeout(timeout)
try:
@@ -97,6 +97,16 @@ def run_gecko_test(testcase, timeout):
print("Failed to get a valid timing measurement.")
return generate_placeholder(testcase)
+ if is_async:
+ # TODO: the timeout is hardcoded
+ driver.implicitly_wait(5) # sec
+ driver.find_element_by_id("GECKO_TEST_DONE")
+ timings.update(json.loads(
+ driver.execute_script(
+ "return JSON.stringify(window.customTimers)"
+ )
+ ))
+
return [timings]