Index: content/test/gpu/gpu_tests/gpu_integration_test.py |
diff --git a/content/test/gpu/gpu_tests/gpu_integration_test.py b/content/test/gpu/gpu_tests/gpu_integration_test.py |
index 75df3cbaec20bc4786ad851953674e8940781cc6..3c4e98d3d4b10d574ce1517231bb019d821c347a 100644 |
--- a/content/test/gpu/gpu_tests/gpu_integration_test.py |
+++ b/content/test/gpu/gpu_tests/gpu_integration_test.py |
@@ -51,12 +51,13 @@ class GpuIntegrationTest( |
logging.warning("GpuIntegrationTest unable to take screenshot") |
raise |
- def _RestartBrowser(self, reason): |
+ @classmethod |
+ def _RestartBrowser(cls, reason): |
logging.warning('Restarting browser due to '+ reason) |
- self.StopBrowser() |
- self.SetBrowserOptions(self._finder_options) |
- self.StartBrowser() |
- self.tab = self.browser.tabs[0] |
+ cls.StopBrowser() |
+ cls.SetBrowserOptions(cls._finder_options) |
+ cls.StartBrowser() |
+ cls.tab = cls.browser.tabs[0] |
def _RunGpuTest(self, url, test_name, *args): |
temp_page = _EmulatedPage(url, test_name) |
@@ -158,12 +159,16 @@ class GpuIntegrationTest( |
# Do not call this directly. Call GetExpectations where necessary. |
raise NotImplementedError |
- def setUp(self): |
+ @classmethod |
+ def _EnsureTabIsAvailable(cls): |
try: |
- self.tab = self.browser.tabs[0] |
+ cls.tab = cls.browser.tabs[0] |
except Exception: |
# restart the browser to make sure a failure in a test doesn't |
# propagate to the next test iteration. |
logging.exception("Failure during browser startup") |
- self._RestartBrowser('failure in setup') |
+ cls._RestartBrowser('failure in setup') |
raise |
+ |
+ def setUp(self): |
+ self._EnsureTabIsAvailable() |