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

Unified Diff: tools/telemetry/telemetry/page/actions/seek_unittest.py

Issue 346923003: Add ActionRunner wrapper for the remaining less used actions (try 2): (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit test to skip test if touch is not supported. Created 6 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 | « tools/telemetry/telemetry/page/actions/seek.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/seek_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/seek_unittest.py b/tools/telemetry/telemetry/page/actions/seek_unittest.py
index 9545ace5ef9d7da9a06693613b2ee273b32e6c08..862c77f369be2d436586480ba526a4613ee1d865 100644
--- a/tools/telemetry/telemetry/page/actions/seek_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/seek_unittest.py
@@ -19,8 +19,7 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWithNoSelector(self):
"""Tests that with no selector Seek action seeks first media element."""
- data = {'wait_for_seeked': True, 'seek_time': 1}
- action = seek.SeekAction(data)
+ action = seek.SeekAction(seconds=1, timeout_in_seconds=10)
action.WillRunAction(self._tab)
action.RunAction(self._tab)
# Assert only first video has played.
@@ -29,8 +28,8 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWithVideoSelector(self):
"""Tests that Seek action seeks video element matching selector."""
- data = {'selector': '#video_1', 'wait_for_seeked': True, 'seek_time': 1}
- action = seek.SeekAction(data)
+ action = seek.SeekAction(seconds=1, selector='#video_1',
+ timeout_in_seconds=10)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
@@ -42,8 +41,8 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWithAllSelector(self):
"""Tests that Seek action seeks all video elements with selector='all'."""
- data = {'selector': 'all', 'wait_for_seeked': True, 'seek_time': 1}
- action = seek.SeekAction(data)
+ action = seek.SeekAction(seconds=1, selector='all',
+ timeout_in_seconds=10)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
@@ -55,19 +54,9 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWaitForSeekTimeout(self):
"""Tests that wait_for_seeked timeouts if video does not seek."""
- data = {'selector': '#video_1',
- 'wait_for_seeked': True,
- 'wait_timeout_in_seconds': 1,
- 'seek_time': 1}
- action = seek.SeekAction(data)
+ action = seek.SeekAction(seconds=1, selector='#video_1',
+ timeout_in_seconds=1)
action.WillRunAction(self._tab)
self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""')
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
self.assertRaises(util.TimeoutException, action.RunAction, self._tab)
-
- def testSeekWithoutSeekTime(self):
- """Tests that seek action fails with no seek time."""
- data = {'wait_for_seeked': True}
- action = seek.SeekAction(data)
- action.WillRunAction(self._tab)
- self.assertRaises(AssertionError, action.RunAction, self._tab)
« no previous file with comments | « tools/telemetry/telemetry/page/actions/seek.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698