Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: tools/chrome_proxy/common/chrome_proxy_measurements.py

Issue 2672803002: [Telemetry refactor] Migrate clients to new JavaScript API (batch 3) (Closed)
Patch Set: add comment on tools/android Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/chrome_proxy/common/chrome_proxy_measurements.py
diff --git a/tools/chrome_proxy/common/chrome_proxy_measurements.py b/tools/chrome_proxy/common/chrome_proxy_measurements.py
index 36b06143f147e82a8751c073986e709b7674bddf..ad41be79d70bb537b817ba5e177a6bad07d73fa2 100644
--- a/tools/chrome_proxy/common/chrome_proxy_measurements.py
+++ b/tools/chrome_proxy/common/chrome_proxy_measurements.py
@@ -51,14 +51,16 @@ def WaitForViaHeader(tab, url="http://check.googlezip.net/test.html"):
'</body></html>'))
# Ensure the page has finished loading before attempting the DRP check.
- tab.WaitForJavaScriptExpression('performance.timing.loadEventEnd', 60)
+ tab.WaitForJavaScriptCondition2('performance.timing.loadEventEnd', timeout=60)
expected_via_header = metrics.CHROME_PROXY_VIA_HEADER
if ChromeProxyValidation.extra_via_header:
expected_via_header = ChromeProxyValidation.extra_via_header
- tab.WaitForJavaScriptExpression(
- 'PollDRPCheck("%s", "%s")' % (url, expected_via_header), 60)
+ tab.WaitForJavaScriptCondition2(
+ 'PollDRPCheck({{ url }}, {{ via_header }})',
+ url=url, via_header=expected_via_header,
+ timeout=60)
class ChromeProxyValidation(legacy_page_test.LegacyPageTest):
@@ -100,7 +102,8 @@ class ChromeProxyValidation(legacy_page_test.LegacyPageTest):
def ValidateAndMeasurePage(self, page, tab, results):
self._page = page
# Wait for the load event.
- tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ tab.WaitForJavaScriptCondition2(
+ 'performance.timing.loadEventStart', timeout=300)
assert self._metrics
self._metrics.Stop(page, tab)
if ChromeProxyValidation.extra_via_header:
« no previous file with comments | « tools/android/loading/devtools_monitor.py ('k') | tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698