OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from telemetry.core import exceptions | 5 from telemetry.core import exceptions |
6 from telemetry import decorators | 6 from telemetry import decorators |
7 from telemetry.page.actions import seek | 7 from telemetry.internal.actions import seek |
8 from telemetry.unittest_util import tab_test_case | 8 from telemetry.unittest_util import tab_test_case |
9 | 9 |
10 AUDIO_1_SEEKED_CHECK = 'window.__hasEventCompleted("#audio_1", "seeked");' | 10 AUDIO_1_SEEKED_CHECK = 'window.__hasEventCompleted("#audio_1", "seeked");' |
11 VIDEO_1_SEEKED_CHECK = 'window.__hasEventCompleted("#video_1", "seeked");' | 11 VIDEO_1_SEEKED_CHECK = 'window.__hasEventCompleted("#video_1", "seeked");' |
12 | 12 |
13 | 13 |
14 class SeekActionTest(tab_test_case.TabTestCase): | 14 class SeekActionTest(tab_test_case.TabTestCase): |
15 | 15 |
16 def setUp(self): | 16 def setUp(self): |
17 tab_test_case.TabTestCase.setUp(self) | 17 tab_test_case.TabTestCase.setUp(self) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 @decorators.Disabled('linux') # crbug.com/418577 | 58 @decorators.Disabled('linux') # crbug.com/418577 |
59 def testSeekWaitForSeekTimeout(self): | 59 def testSeekWaitForSeekTimeout(self): |
60 """Tests that wait_for_seeked timeouts if video does not seek.""" | 60 """Tests that wait_for_seeked timeouts if video does not seek.""" |
61 action = seek.SeekAction(seconds=1, selector='#video_1', | 61 action = seek.SeekAction(seconds=1, selector='#video_1', |
62 timeout_in_seconds=0.1) | 62 timeout_in_seconds=0.1) |
63 action.WillRunAction(self._tab) | 63 action.WillRunAction(self._tab) |
64 self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""') | 64 self._tab.EvaluateJavaScript('document.getElementById("video_1").src = ""') |
65 self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK)) | 65 self.assertFalse(self._tab.EvaluateJavaScript(VIDEO_1_SEEKED_CHECK)) |
66 self.assertRaises(exceptions.TimeoutException, action.RunAction, self._tab) | 66 self.assertRaises(exceptions.TimeoutException, action.RunAction, self._tab) |
OLD | NEW |