| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import logging | 5 import logging |
| 6 | 6 |
| 7 from telemetry.testing import serially_executed_browser_test_case | 7 from telemetry.testing import serially_executed_browser_test_case |
| 8 | 8 |
| 9 from gpu_tests import exception_formatter | 9 from gpu_tests import exception_formatter |
| 10 from gpu_tests import gpu_test_expectations | 10 from gpu_tests import gpu_test_expectations |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 yield test_name, (url, test_name, args) | 30 yield test_name, (url, test_name, args) |
| 31 | 31 |
| 32 def _RestartBrowser(self, reason): | 32 def _RestartBrowser(self, reason): |
| 33 logging.warning('Restarting browser due to ' + reason) | 33 logging.warning('Restarting browser due to ' + reason) |
| 34 self.StopBrowser() | 34 self.StopBrowser() |
| 35 self.SetBrowserOptions(self._finder_options) | 35 self.SetBrowserOptions(self._finder_options) |
| 36 self.StartBrowser() | 36 self.StartBrowser() |
| 37 self.tab = self.browser.tabs[0] | 37 self.tab = self.browser.tabs[0] |
| 38 | 38 |
| 39 def _RunGpuTest(self, url, test_name, args): | 39 def _RunGpuTest(self, url, test_name, args): |
| 40 print 'ENTERING _RunGpuTest for ' + test_name |
| 40 temp_page = _EmulatedPage(url, test_name) | 41 temp_page = _EmulatedPage(url, test_name) |
| 41 expectations = self.__class__.GetExpectations() | 42 expectations = self.__class__.GetExpectations() |
| 42 expectation = expectations.GetExpectationForPage( | 43 expectation = expectations.GetExpectationForPage( |
| 43 self.browser, temp_page) | 44 self.browser, temp_page) |
| 44 if expectation == 'skip': | 45 if expectation == 'skip': |
| 45 # skipTest in Python's unittest harness raises an exception, so | 46 # skipTest in Python's unittest harness raises an exception, so |
| 46 # aborts the control flow here. | 47 # aborts the control flow here. |
| 47 self.skipTest('SKIPPING TEST due to test expectations') | 48 self.skipTest('SKIPPING TEST due to test expectations') |
| 48 try: | 49 try: |
| 49 self.RunActualGpuTest(url, *args) | 50 self.RunActualGpuTest(url, *args) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 @classmethod | 121 @classmethod |
| 121 def _CreateExpectations(cls): | 122 def _CreateExpectations(cls): |
| 122 # Subclasses **must** override this in order to provide their test | 123 # Subclasses **must** override this in order to provide their test |
| 123 # expectations to the harness. | 124 # expectations to the harness. |
| 124 # | 125 # |
| 125 # Do not call this directly. Call GetExpectations where necessary. | 126 # Do not call this directly. Call GetExpectations where necessary. |
| 126 raise NotImplementedError | 127 raise NotImplementedError |
| 127 | 128 |
| 128 def setUp(self): | 129 def setUp(self): |
| 129 self.tab = self.browser.tabs[0] | 130 self.tab = self.browser.tabs[0] |
| OLD | NEW |