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

Unified Diff: telemetry/telemetry/internal/actions/tap.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/tap.js ('k') | telemetry/telemetry/internal/actions/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/tap.py
diff --git a/telemetry/telemetry/internal/actions/tap.py b/telemetry/telemetry/internal/actions/tap.py
index ba234aad69afd4730c440dc414331aec3cbf6e07..092e8a8b083271c373264007a4270c7d956dc1b5 100644
--- a/telemetry/telemetry/internal/actions/tap.py
+++ b/telemetry/telemetry/internal/actions/tap.py
@@ -2,9 +2,8 @@
# 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 TapAction(page_action.PageAction):
@@ -23,10 +22,8 @@ class TapAction(page_action.PageAction):
synthetic_gesture_source)
def WillRunAction(self, tab):
- for js_file in ['gesture_common.js', 'tap.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, 'tap.js')
# Fail if browser doesn't support synthetic tap gestures.
if not tab.EvaluateJavaScript('window.__TapAction_SupportedByBrowser()'):
« no previous file with comments | « telemetry/telemetry/internal/actions/tap.js ('k') | telemetry/telemetry/internal/actions/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698