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

Unified Diff: tools/chrome_proxy/integration_tests/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/integration_tests/chrome_proxy_measurements.py
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
index 6754a60fae699ab24264843ebbfa7601f3955c01..55d1a3da0236dc5f0b7112c7276d71659326f2ee 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
@@ -47,7 +47,8 @@ class ChromeProxyDataSaving(legacy_page_test.LegacyPageTest):
def ValidateAndMeasurePage(self, page, tab, results):
# Wait for the load event.
- tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ tab.WaitForJavaScriptCondition2(
+ 'performance.timing.loadEventStart', timeout=300)
self._metrics.Stop(page, tab)
self._metrics.AddResultsForDataSaving(tab, results)
@@ -123,7 +124,7 @@ class ChromeProxyCorsBypass(ChromeProxyValidation):
def ValidateAndMeasurePage(self, page, tab, results):
# The test page sets window.xhrRequestCompleted to true when the XHR fetch
# finishes.
- tab.WaitForJavaScriptExpression('window.xhrRequestCompleted', 300)
+ tab.WaitForJavaScriptCondition2('window.xhrRequestCompleted', timeout=300)
super(ChromeProxyCorsBypass,
self).ValidateAndMeasurePage(page, tab, results)
@@ -365,7 +366,7 @@ class ChromeProxyCacheLoFiDisabled(ChromeProxyValidation):
def DidNavigateToPage(self, page, tab):
if not self._is_lo_fi_enabled:
- tab.ExecuteJavaScript('window.location.reload()')
+ tab.ExecuteJavaScript2('window.location.reload()')
util.WaitFor(tab.HasReachedQuiescence, 3)
class ChromeProxyCacheProxyDisabled(ChromeProxyValidation):
@@ -412,7 +413,7 @@ class ChromeProxyCacheProxyDisabled(ChromeProxyValidation):
def DidNavigateToPage(self, page, tab):
if not self._is_chrome_proxy_enabled:
- tab.ExecuteJavaScript('window.location.reload()')
+ tab.ExecuteJavaScript2('window.location.reload()')
util.WaitFor(tab.HasReachedQuiescence, 3)
class ChromeProxyLitePage(ChromeProxyValidation):
@@ -501,7 +502,8 @@ class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation):
# cause a proxy fallback, and have this test run starting from the HTTP
# fallback proxy.
tab.Navigate(_TEST_SERVER_DEFAULT_URL)
- tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ tab.WaitForJavaScriptCondition2(
+ 'performance.timing.loadEventStart', timeout=300)
def AddResults(self, tab, results):
self._metrics.AddResultsForHTTPToDirectFallback(tab, results, _TEST_SERVER)
@@ -602,7 +604,8 @@ class ChromeProxyQuicSmoke(legacy_page_test.LegacyPageTest):
def ValidateAndMeasurePage(self, page, tab, results):
# Wait for the load event.
- tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ tab.WaitForJavaScriptCondition2(
+ 'performance.timing.loadEventStart', timeout=300)
self._metrics.Stop(page, tab)
page_to_metrics = {
'header validation': [self._metrics.AddResultsForHeaderValidation],
@@ -800,6 +803,7 @@ class ChromeProxyQuicTransaction(legacy_page_test.LegacyPageTest):
def ValidateAndMeasurePage(self, page, tab, results):
# Wait for the load event.
- tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ tab.WaitForJavaScriptCondition2(
+ 'performance.timing.loadEventStart', timeout=300)
self._metrics.Stop(page, tab)
self._metrics.AddResultsForQuicTransaction(tab, results)
« no previous file with comments | « tools/chrome_proxy/common/chrome_proxy_measurements.py ('k') | tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698