| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import unittest | 4 import unittest |
| 5 | 5 |
| 6 from telemetry import benchmark as benchmark_module | 6 from telemetry import benchmark as benchmark_module |
| 7 from telemetry.core import exceptions | 7 from telemetry.core import exceptions |
| 8 from telemetry.story import story_set as story_set_module | 8 from telemetry.story import story_set as story_set_module |
| 9 from telemetry.testing import fakes | 9 from telemetry.testing import fakes |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 self._times_to_fail = times_to_fail | 123 self._times_to_fail = times_to_fail |
| 124 self.RunNavigateSteps.side_effect = self.maybeFail | 124 self.RunNavigateSteps.side_effect = self.maybeFail |
| 125 | 125 |
| 126 def maybeFail(self, action_runner): | 126 def maybeFail(self, action_runner): |
| 127 if self._times_to_fail > 0: | 127 if self._times_to_fail > 0: |
| 128 self._times_to_fail = self._times_to_fail - 1 | 128 self._times_to_fail = self._times_to_fail - 1 |
| 129 raise Exception('Deliberate exception') | 129 raise Exception('Deliberate exception') |
| 130 | 130 |
| 131 class PageRunExecutionTest(unittest.TestCase): | 131 class PageRunExecutionTest(unittest.TestCase): |
| 132 def testNoGarbageCollectionCalls(self): | 132 def testNoGarbageCollectionCalls(self): |
| 133 assert False |
| 133 mock_shared_state = mock.Mock() | 134 mock_shared_state = mock.Mock() |
| 134 p = gpu_test_base.PageBase('file://foo.html') | 135 p = gpu_test_base.PageBase('file://foo.html') |
| 135 p.Run(mock_shared_state) | 136 p.Run(mock_shared_state) |
| 136 expected = [mock.call.page_test.WillNavigateToPage( | 137 expected = [mock.call.page_test.WillNavigateToPage( |
| 137 p, mock_shared_state.current_tab), | 138 p, mock_shared_state.current_tab), |
| 138 mock.call.page_test.RunNavigateSteps( | 139 mock.call.page_test.RunNavigateSteps( |
| 139 p, mock_shared_state.current_tab), | 140 p, mock_shared_state.current_tab), |
| 140 mock.call.page_test.DidNavigateToPage( | 141 mock.call.page_test.DidNavigateToPage( |
| 141 p, mock_shared_state.current_tab)] | 142 p, mock_shared_state.current_tab)] |
| 142 self.assertEquals(mock_shared_state.mock_calls, expected) | 143 self.assertEquals(mock_shared_state.mock_calls, expected) |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 mock.call.page2.RunNavigateSteps(mock.ANY), | 389 mock.call.page2.RunNavigateSteps(mock.ANY), |
| 389 mock.call.validator.WillNavigateToPage( | 390 mock.call.validator.WillNavigateToPage( |
| 390 page2, mock.ANY), | 391 page2, mock.ANY), |
| 391 mock.call.page2.RunNavigateSteps(mock.ANY), | 392 mock.call.page2.RunNavigateSteps(mock.ANY), |
| 392 mock.call.validator.DidNavigateToPage( | 393 mock.call.validator.DidNavigateToPage( |
| 393 page2, mock.ANY), | 394 page2, mock.ANY), |
| 394 mock.call.page2.RunPageInteractions(mock.ANY), | 395 mock.call.page2.RunPageInteractions(mock.ANY), |
| 395 mock.call.validator.ValidateAndMeasurePage( | 396 mock.call.validator.ValidateAndMeasurePage( |
| 396 page2, mock.ANY, mock.ANY)] | 397 page2, mock.ANY, mock.ANY)] |
| 397 self.assertTrue(manager.mock_calls == expected) | 398 self.assertTrue(manager.mock_calls == expected) |
| OLD | NEW |