| Index: telemetry/telemetry/internal/actions/swipe.py
|
| diff --git a/telemetry/telemetry/internal/actions/swipe.py b/telemetry/telemetry/internal/actions/swipe.py
|
| index 3376de8cb271bde96c988ddf849ac7567135ba60..7c96d3957c4edce516c772a8ea99fa74df089768 100644
|
| --- a/telemetry/telemetry/internal/actions/swipe.py
|
| +++ b/telemetry/telemetry/internal/actions/swipe.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 SwipeAction(page_action.PageAction):
|
| @@ -28,10 +27,8 @@ class SwipeAction(page_action.PageAction):
|
| synthetic_gesture_source)
|
|
|
| def WillRunAction(self, tab):
|
| - for js_file in ['gesture_common.js', 'swipe.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, 'swipe.js')
|
|
|
| # Fail if browser doesn't support synthetic swipe gestures.
|
| if not tab.EvaluateJavaScript('window.__SwipeAction_SupportedByBrowser()'):
|
|
|