Chromium Code Reviews| Index: content/test/gpu/gpu_tests/gpu_integration_test_unittest.py |
| diff --git a/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py b/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py |
| index df1de72410467220f4d253e12e93f5260f18a5fe..786e37d396718045960a9bf4955bd22dc267ad6a 100644 |
| --- a/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py |
| +++ b/content/test/gpu/gpu_tests/gpu_integration_test_unittest.py |
| @@ -16,6 +16,7 @@ import gpu_project_config |
| from gpu_tests import gpu_integration_test |
| from gpu_tests import gpu_test_expectations |
| +_GLOBAL_TEST_COUNT = 0 |
| class SimpleIntegrationUnittest(gpu_integration_test.GpuIntegrationTest): |
| # Must be class-scoped since instances aren't reused across runs. |
| @@ -27,6 +28,16 @@ class SimpleIntegrationUnittest(gpu_integration_test.GpuIntegrationTest): |
| def Name(cls): |
| return 'simple_integration_unittest' |
| + def setUp(self): |
| + super(SimpleIntegrationUnittest, self).setUp() |
| + global _GLOBAL_TEST_COUNT |
| + _GLOBAL_TEST_COUNT += 1 |
| + # If this is the first test, fail on setup to ensure that the |
| + # gpu_integration_test handles failures in setup and remaining tests |
| + # can be executed |
| + if _GLOBAL_TEST_COUNT == 1: |
| + self.tab.Navigate('chrome://crash') |
|
Ken Russell (switch to Gerrit)
2016/07/14 21:38:22
Per comments in https://codereview.chromium.org/21
eyaich
2016/07/15 13:30:27
Done.
|
| + |
| @classmethod |
| def setUpClass(cls): |
| finder_options = fakes.CreateBrowserFinderOptions() |
| @@ -44,6 +55,7 @@ class SimpleIntegrationUnittest(gpu_integration_test.GpuIntegrationTest): |
| @classmethod |
| def GenerateGpuTests(cls, options): |
| + yield ('setup', 'pass.html', ()) |
| yield ('expected_failure', 'failure.html', ()) |
| yield ('expected_flaky', 'flaky.html', ()) |
| yield ('expected_skip', 'failure.html', ()) |
| @@ -96,10 +108,11 @@ class GpuIntegrationTestUnittest(unittest.TestCase): |
| 'unexpected_failure']) |
| self.assertEquals(test_result['successes'], [ |
| 'expected_failure', |
| - 'expected_flaky']) |
| + 'expected_flaky', |
| + 'setup']) |
| self.assertEquals(test_result['valid'], True) |
| # It might be nice to be more precise about the order of operations |
| # with these browser restarts, but this is at least a start. |
| - self.assertEquals(SimpleIntegrationUnittest._num_browser_starts, 5) |
| + self.assertEquals(SimpleIntegrationUnittest._num_browser_starts, 6) |
| finally: |
| os.remove(temp_file_name) |