| 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.
|
|
|
|
|