Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2172)

Unified Diff: content/test/gpu/gpu_tests/gpu_integration_test_unittest.py

Issue 2151983002: Adding logic to restart the browser if there is an exception (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Syncing client Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_integration_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7d87ff89862b51ac2cf229a2f11c03504f232d7d 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):
+ 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')
+ super(SimpleIntegrationUnittest, self).setUp()
+
@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', 'failure.html', ())
yield ('expected_failure', 'failure.html', ())
yield ('expected_flaky', 'flaky.html', ())
yield ('expected_skip', 'failure.html', ())
@@ -92,14 +104,15 @@ class GpuIntegrationTestUnittest(unittest.TestCase):
with open(temp_file_name) as f:
test_result = json.load(f)
self.assertEquals(test_result['failures'], [
+ 'expected_failure',
+ 'setup',
'unexpected_error',
'unexpected_failure'])
self.assertEquals(test_result['successes'], [
- 'expected_failure',
'expected_flaky'])
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)
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_integration_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698