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

Unified Diff: telemetry/telemetry/internal/actions/scroll_bounce.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
Index: telemetry/telemetry/internal/actions/scroll_bounce.py
diff --git a/telemetry/telemetry/internal/actions/scroll_bounce.py b/telemetry/telemetry/internal/actions/scroll_bounce.py
index 672351f04f124d4589633b21eea3acc4008fac62..4eb0b6cc7559601cf0aec8830ce5a997f8e60e78 100644
--- a/telemetry/telemetry/internal/actions/scroll_bounce.py
+++ b/telemetry/telemetry/internal/actions/scroll_bounce.py
@@ -1,9 +1,9 @@
# Copyright 2014 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 ScrollBounceAction(page_action.PageAction):
@@ -41,10 +41,8 @@ class ScrollBounceAction(page_action.PageAction):
self._element_function = '(document.scrollingElement || document.body)'
def WillRunAction(self, tab):
- for js_file in ['gesture_common.js', 'scroll_bounce.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, 'scroll_bounce.js')
# Fail if browser doesn't support synthetic scroll bounce gestures.
if not tab.EvaluateJavaScript(
« no previous file with comments | « telemetry/telemetry/internal/actions/scroll_bounce.js ('k') | telemetry/telemetry/internal/actions/scroll_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698