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

Unified Diff: telemetry/telemetry/internal/actions/pinch.py

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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
« no previous file with comments | « telemetry/telemetry/internal/actions/pinch.js ('k') | telemetry/telemetry/internal/actions/play.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/pinch.py
diff --git a/telemetry/telemetry/internal/actions/pinch.py b/telemetry/telemetry/internal/actions/pinch.py
index c1d76b6647efb6f36f42741e8c05ecc8aef1ee15..223a5cc02c0fd6f0b37a1f805cc270cab543682e 100644
--- a/telemetry/telemetry/internal/actions/pinch.py
+++ b/telemetry/telemetry/internal/actions/pinch.py
@@ -1,9 +1,9 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import os
from telemetry.internal.actions import page_action
+from telemetry.internal.actions import utils
class PinchAction(page_action.PageAction):
@@ -27,10 +27,8 @@ class PinchAction(page_action.PageAction):
self._element_function = 'document.body'
def WillRunAction(self, tab):
- for js_file in ['gesture_common.js', 'pinch.js']:
- with open(os.path.join(os.path.dirname(__file__), js_file)) as f:
- js = f.read()
- tab.ExecuteJavaScript(js)
+ utils.InjectJavaScript(tab, 'gesture_common.js')
+ utils.InjectJavaScript(tab, 'pinch.js')
# Fail if browser doesn't support synthetic pinch gestures.
if not tab.EvaluateJavaScript('window.__PinchAction_SupportedByBrowser()'):
« no previous file with comments | « telemetry/telemetry/internal/actions/pinch.js ('k') | telemetry/telemetry/internal/actions/play.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698