Commit f9d01015 authored by tonyg's avatar tonyg Committed by Commit bot

[Telemetry] Chose some slightly more reasonable timeouts for actions.

For certain unittest failures, these long timeouts were causing cycle
time problems for the bots. This CL mitigates those delays.

BUG=418577

Review URL: https://codereview.chromium.org/646063002

Cr-Commit-Position: refs/heads/master@{#299205}
parent 0707401c
......@@ -20,7 +20,8 @@ class LoopActionTest(tab_test_case.TabTestCase):
@decorators.Disabled('android')
def testLoopWithNoSelector(self):
"""Tests that with no selector Loop action loops first media element."""
action = loop.LoopAction(loop_count=2, selector='#video_1')
action = loop.LoopAction(loop_count=2, selector='#video_1',
timeout_in_seconds=10)
action.WillRunAction(self._tab)
action.RunAction(self._tab)
# Assert only first video has played.
......@@ -30,7 +31,8 @@ class LoopActionTest(tab_test_case.TabTestCase):
@decorators.Disabled('android')
def testLoopWithAllSelector(self):
"""Tests that Loop action loops all video elements with selector='all'."""
action = loop.LoopAction(loop_count=2, selector='all')
action = loop.LoopAction(loop_count=2, selector='all',
timeout_in_seconds=10)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_LOOP_CHECK))
......
......@@ -21,7 +21,7 @@ class PlayActionTest(tab_test_case.TabTestCase):
@decorators.Disabled('android')
def testPlayWithNoSelector(self):
"""Tests that with no selector Play action plays first video element."""
action = play.PlayAction(playing_event_timeout_in_seconds=60)
action = play.PlayAction(playing_event_timeout_in_seconds=5)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
......@@ -35,7 +35,7 @@ class PlayActionTest(tab_test_case.TabTestCase):
def testPlayWithVideoSelector(self):
"""Tests that Play action plays video element matching selector."""
action = play.PlayAction(selector='#video_1',
playing_event_timeout_in_seconds=60)
playing_event_timeout_in_seconds=5)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
......@@ -49,7 +49,7 @@ class PlayActionTest(tab_test_case.TabTestCase):
def testPlayWithAllSelector(self):
"""Tests that Play action plays all video elements with selector='all'."""
action = play.PlayAction(selector='all',
playing_event_timeout_in_seconds=60)
playing_event_timeout_in_seconds=5)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
......@@ -63,7 +63,7 @@ class PlayActionTest(tab_test_case.TabTestCase):
def testPlayWaitForPlayTimeout(self):
"""Tests that wait_for_playing timeouts if video does not play."""
action = play.PlayAction(selector='#video_1',
playing_event_timeout_in_seconds=0.1)
playing_event_timeout_in_seconds=5)
action.WillRunAction(self._tab)
self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""')
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
......@@ -73,7 +73,7 @@ class PlayActionTest(tab_test_case.TabTestCase):
def testPlayWaitForEnded(self):
"""Tests that wait_for_ended waits for video to end."""
action = play.PlayAction(selector='#video_1',
ended_event_timeout_in_seconds=60)
ended_event_timeout_in_seconds=5)
action.WillRunAction(self._tab)
# Assert video not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_PLAYING_CHECK))
......
......@@ -18,7 +18,7 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWithNoSelector(self):
"""Tests that with no selector Seek action seeks first media element."""
action = seek.SeekAction(seconds=1, timeout_in_seconds=10)
action = seek.SeekAction(seconds=1, timeout_in_seconds=5)
action.WillRunAction(self._tab)
action.RunAction(self._tab)
# Assert only first video has played.
......@@ -28,7 +28,7 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWithVideoSelector(self):
"""Tests that Seek action seeks video element matching selector."""
action = seek.SeekAction(seconds=1, selector='#video_1',
timeout_in_seconds=10)
timeout_in_seconds=5)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
......@@ -41,7 +41,7 @@ class SeekActionTest(tab_test_case.TabTestCase):
def testSeekWithAllSelector(self):
"""Tests that Seek action seeks all video elements with selector='all'."""
action = seek.SeekAction(seconds=1, selector='all',
timeout_in_seconds=10)
timeout_in_seconds=5)
action.WillRunAction(self._tab)
# Both videos not playing before running action.
self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment