Index: tools/telemetry/telemetry/page/actions/play_unittest.py |
diff --git a/tools/telemetry/telemetry/page/actions/play_unittest.py b/tools/telemetry/telemetry/page/actions/play_unittest.py |
index ab1aae0e49f4a7ec9ffe7015b47573685df85c09..dc2052ad5c2245386ae1eb8361659463c259a096 100644 |
--- a/tools/telemetry/telemetry/page/actions/play_unittest.py |
+++ b/tools/telemetry/telemetry/page/actions/play_unittest.py |
@@ -22,8 +22,7 @@ class PlayActionTest(tab_test_case.TabTestCase): |
@decorators.Disabled('android') |
def testPlayWithNoSelector(self): |
"""Tests that with no selector Play action plays first video element.""" |
- data = {'wait_for_playing': True} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(playing_event_timeout_in_seconds=60) |
action.WillRunAction(self._tab) |
# Both videos not playing before running action. |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |
@@ -36,8 +35,8 @@ class PlayActionTest(tab_test_case.TabTestCase): |
@decorators.Disabled('android') |
def testPlayWithVideoSelector(self): |
"""Tests that Play action plays video element matching selector.""" |
- data = {'selector': '#video_1', 'wait_for_playing': True} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(selector='#video_1', |
+ playing_event_timeout_in_seconds=60) |
action.WillRunAction(self._tab) |
# Both videos not playing before running action. |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |
@@ -50,8 +49,8 @@ class PlayActionTest(tab_test_case.TabTestCase): |
@decorators.Disabled('android') |
def testPlayWithAllSelector(self): |
"""Tests that Play action plays all video elements with selector='all'.""" |
- data = {'selector': 'all', 'wait_for_playing': True} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(selector='all', |
+ playing_event_timeout_in_seconds=60) |
action.WillRunAction(self._tab) |
# Both videos not playing before running action. |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |
@@ -64,10 +63,8 @@ class PlayActionTest(tab_test_case.TabTestCase): |
# http://crbug.com/273887 |
def testPlayWaitForPlayTimeout(self): |
"""Tests that wait_for_playing timeouts if video does not play.""" |
- data = {'selector': '#video_1', |
- 'wait_for_playing': True, |
- 'wait_timeout_in_seconds': 1} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(selector='#video_1', |
+ playing_event_timeout_in_seconds=1) |
action.WillRunAction(self._tab) |
self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""') |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |
@@ -76,8 +73,8 @@ class PlayActionTest(tab_test_case.TabTestCase): |
@decorators.Disabled('android') |
def testPlayWaitForEnded(self): |
"""Tests that wait_for_ended waits for video to end.""" |
- data = {'selector': '#video_1', 'wait_for_ended': True} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(selector='#video_1', |
+ ended_event_timeout_in_seconds=60) |
action.WillRunAction(self._tab) |
# Assert video not playing before running action. |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |
@@ -88,8 +85,8 @@ class PlayActionTest(tab_test_case.TabTestCase): |
def testPlayWithoutWaitForEnded(self): |
"""Tests that wait_for_ended waits for video to end.""" |
- data = {'selector': '#video_1', 'wait_for_ended': False} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(selector='#video_1', |
+ ended_event_timeout_in_seconds=0) |
action.WillRunAction(self._tab) |
# Assert video not playing before running action. |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |
@@ -100,9 +97,8 @@ class PlayActionTest(tab_test_case.TabTestCase): |
def testPlayWaitForEndedTimeout(self): |
"""Tests that action raises exception if timeout is reached.""" |
- data = {'selector': '#video_1', 'wait_for_ended': True, |
- 'wait_timeout_in_seconds': 1} |
- action = play.PlayAction(data) |
+ action = play.PlayAction(selector='#video_1', |
+ ended_event_timeout_in_seconds=1) |
action.WillRunAction(self._tab) |
# Assert video not playing before running action. |
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK)) |