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

Unified Diff: tools/telemetry/telemetry/page/actions/loop_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/loop.py ('k') | tools/telemetry/telemetry/page/actions/pinch.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/loop_unittest.py
diff --git a/tools/telemetry/telemetry/page/actions/loop_unittest.py b/tools/telemetry/telemetry/page/actions/loop_unittest.py
index 8a6c52dd6178c79359361bf1e41949dd2b77e525..3d8c8f632141566200cb7e0d219008aa9afdcfe2 100644
--- a/tools/telemetry/telemetry/page/actions/loop_unittest.py
+++ b/tools/telemetry/telemetry/page/actions/loop_unittest.py
@@ -21,8 +21,7 @@ class LoopActionTest(tab_test_case.TabTestCase):
@decorators.Disabled('android')
def testLoopWithNoSelector(self):
"""Tests that with no selector Loop action loops first media element."""
- data = {'selector': '#video_1', 'loop_count': 2}
- action = loop.LoopAction(data)
+ action = loop.LoopAction(loop_count=2, selector='#video_1')
action.WillRunAction(self._tab)
action.RunAction(self._tab)
# Assert only first video has played.
@@ -32,8 +31,7 @@ class LoopActionTest(tab_test_case.TabTestCase):
@decorators.Disabled('android')
def testLoopWithAllSelector(self):
"""Tests that Loop action loops all video elements with selector='all'."""
- data = {'selector': 'all', 'loop_count': 2}
- action = loop.LoopAction(data)
+ action = loop.LoopAction(loop_count=2, selector='all')
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_LOOP_CHECK))
@@ -46,18 +44,8 @@ class LoopActionTest(tab_test_case.TabTestCase):
@decorators.Disabled('android')
def testLoopWaitForLoopTimeout(self):
"""Tests that wait_for_loop timeout_in_secondss if video does not loop."""
- data = {'selector': '#video_1',
- 'wait_timeout_in_seconds': 1,
- 'loop_count': 2}
- action = loop.LoopAction(data)
+ action = loop.LoopAction(loop_count=2, selector='#video_1',
+ timeout_in_seconds=1)
action.WillRunAction(self._tab)
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_LOOP_CHECK))
self.assertRaises(util.TimeoutException, action.RunAction, self._tab)
-
- @decorators.Disabled('android')
- def testLoopWithoutLoopCount(self):
- """Tests that loop action fails with no loop count."""
- data = {}
- action = loop.LoopAction(data)
- action.WillRunAction(self._tab)
- self.assertRaises(AssertionError, action.RunAction, self._tab)
« no previous file with comments | « tools/telemetry/telemetry/page/actions/loop.py ('k') | tools/telemetry/telemetry/page/actions/pinch.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698