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

Unified Diff: telemetry/telemetry/internal/actions/media_action.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/loop.py ('k') | telemetry/telemetry/internal/actions/mouse_click.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/media_action.py
diff --git a/telemetry/telemetry/internal/actions/media_action.py b/telemetry/telemetry/internal/actions/media_action.py
index 446f79714f6ea718e3ef4ea021df3c207cec5a6b..438f5259a186772c2d9f77092219b73c3d456f52 100644
--- a/telemetry/telemetry/internal/actions/media_action.py
+++ b/telemetry/telemetry/internal/actions/media_action.py
@@ -5,26 +5,20 @@
"""Common media action functions."""
import logging
-import os
from telemetry.core import util
from telemetry.internal.actions import page_action
+from telemetry.internal.actions import utils
class MediaAction(page_action.PageAction):
def WillRunAction(self, tab):
"""Loads the common media action JS code prior to running the action."""
- self.LoadJS(tab, 'media_action.js')
+ utils.InjectJavaScript(tab, 'media_action.js')
def RunAction(self, tab):
super(MediaAction, self).RunAction(tab)
- def LoadJS(self, tab, js_file_name):
- """Loads and executes a JS file in the tab."""
- with open(os.path.join(os.path.dirname(__file__), js_file_name)) as f:
- js = f.read()
- tab.ExecuteJavaScript(js)
-
def WaitForEvent(self, tab, selector, event_name, timeout_in_seconds):
"""Halts media action until the selector's event is fired.
« no previous file with comments | « telemetry/telemetry/internal/actions/loop.py ('k') | telemetry/telemetry/internal/actions/mouse_click.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698