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

Unified Diff: content/test/gpu/gpu_tests/maps_integration_test.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: content/test/gpu/gpu_tests/maps_integration_test.py
diff --git a/content/test/gpu/gpu_tests/maps_integration_test.py b/content/test/gpu/gpu_tests/maps_integration_test.py
index 1180162a7a393f96216471aeebbfbd6bb2c15548..891421ca799c2492094308837a8eaf1a4486b826 100644
--- a/content/test/gpu/gpu_tests/maps_integration_test.py
+++ b/content/test/gpu/gpu_tests/maps_integration_test.py
@@ -11,7 +11,6 @@ from gpu_tests import cloud_storage_integration_test_base
from gpu_tests import maps_expectations
from gpu_tests import path_util
-import py_utils
from py_utils import cloud_storage
data_path = os.path.join(path_util.GetChromiumSrcDir(),
@@ -87,35 +86,30 @@ class MapsIntegrationTest(
return json_contents
def _SpinWaitOnRAF(self, iterations, timeout=60):
- tab = self.tab
- waitScript = r"""
- window.__spinWaitOnRAFDone = false;
- var iterationsLeft = %d;
-
- function spin() {
- iterationsLeft--;
- if (iterationsLeft == 0) {
- window.__spinWaitOnRAFDone = true;
- return;
+ self.tab.ExecuteJavaScript2("""
+ window.__spinWaitOnRAFDone = false;
+ var iterationsLeft = {{ iterations }};
+
+ function spin() {
+ iterationsLeft--;
+ if (iterationsLeft == 0) {
+ window.__spinWaitOnRAFDone = true;
+ return;
+ }
+ window.requestAnimationFrame(spin);
}
window.requestAnimationFrame(spin);
- }
- window.requestAnimationFrame(spin);
- """ % iterations
-
- def IsWaitComplete():
- return tab.EvaluateJavaScript('window.__spinWaitOnRAFDone')
-
- tab.ExecuteJavaScript(waitScript)
- py_utils.WaitFor(IsWaitComplete, timeout)
+ """, iterations=iterations)
+ self.tab.WaitForJavaScriptCondition2(
+ 'window.__spinWaitOnRAFDone', timeout=timeout)
def RunActualGpuTest(self, url, *args):
tab = self.tab
pixel_expectations_file = args[0]
action_runner = tab.action_runner
action_runner.Navigate(url)
- action_runner.WaitForJavaScriptCondition(
- 'window.testDone', timeout_in_seconds=180)
+ action_runner.WaitForJavaScriptCondition2(
+ 'window.testDone', timeout=180)
# TODO(kbr): This should not be necessary, but it's not clear if the test
# is failing on the bots in its absence. Remove once we can verify that
@@ -128,7 +122,7 @@ class MapsIntegrationTest(
if screenshot is None:
self.fail('Could not capture screenshot')
- dpr = tab.EvaluateJavaScript('window.devicePixelRatio')
+ dpr = tab.EvaluateJavaScript2('window.devicePixelRatio')
print 'Maps\' devicePixelRatio is ' + str(dpr)
# Even though the Maps test uses a fixed devicePixelRatio so that
# it fetches all of the map tiles at the same resolution, on two

Powered by Google App Engine
This is Rietveld 408576698