| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 os | 4 import os |
| 5 import time | 5 import time |
| 6 | 6 |
| 7 import context_lost_expectations | 7 from gpu_tests import context_lost_expectations |
| 8 import gpu_test_base | 8 from gpu_tests import gpu_test_base |
| 9 import path_util | 9 from gpu_tests import path_util |
| 10 | 10 |
| 11 from telemetry.core import exceptions | 11 from telemetry.core import exceptions |
| 12 from telemetry.core import util | 12 from telemetry.core import util |
| 13 from telemetry.page import page_test | 13 from telemetry.page import page_test |
| 14 from telemetry.story import story_set as story_set_module | 14 from telemetry.story import story_set as story_set_module |
| 15 | 15 |
| 16 data_path = os.path.join( | 16 data_path = os.path.join( |
| 17 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') | 17 path_util.GetChromiumSrcDir(), 'content', 'test', 'data', 'gpu') |
| 18 | 18 |
| 19 wait_timeout = 60 # seconds | 19 wait_timeout = 60 # seconds |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 # same page's context -- is much more stressful than restarting | 80 # same page's context -- is much more stressful than restarting |
| 81 # the browser every time. | 81 # the browser every time. |
| 82 for x in range(page.number_of_gpu_process_kills): | 82 for x in range(page.number_of_gpu_process_kills): |
| 83 if not tab.browser.supports_tab_control: | 83 if not tab.browser.supports_tab_control: |
| 84 raise page_test.Failure('Browser must support tab control') | 84 raise page_test.Failure('Browser must support tab control') |
| 85 | 85 |
| 86 expected_kills = x + 1 | 86 expected_kills = x + 1 |
| 87 | 87 |
| 88 # Reset the test's state. | 88 # Reset the test's state. |
| 89 tab.EvaluateJavaScript( | 89 tab.EvaluateJavaScript( |
| 90 'window.domAutomationController.reset()'); | 90 'window.domAutomationController.reset()') |
| 91 | 91 |
| 92 # If we're running the GPU process crash test, we need the | 92 # If we're running the GPU process crash test, we need the |
| 93 # test to have fully reset before crashing the GPU process. | 93 # test to have fully reset before crashing the GPU process. |
| 94 if page.check_crash_count: | 94 if page.check_crash_count: |
| 95 util.WaitFor(lambda: tab.EvaluateJavaScript( | 95 util.WaitFor(lambda: tab.EvaluateJavaScript( |
| 96 'window.domAutomationController._finished'), wait_timeout) | 96 'window.domAutomationController._finished'), wait_timeout) |
| 97 | 97 |
| 98 # Crash the GPU process. | 98 # Crash the GPU process. |
| 99 gpucrash_tab = tab.browser.tabs.New() | 99 gpucrash_tab = tab.browser.tabs.New() |
| 100 # To access these debug URLs from Telemetry, they have to be | 100 # To access these debug URLs from Telemetry, they have to be |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 ps, ps.base_dir, self.GetExpectations())) | 349 ps, ps.base_dir, self.GetExpectations())) |
| 350 ps.AddStory(WebGLContextLostFromLoseContextExtensionPage( | 350 ps.AddStory(WebGLContextLostFromLoseContextExtensionPage( |
| 351 ps, ps.base_dir, self.GetExpectations())) | 351 ps, ps.base_dir, self.GetExpectations())) |
| 352 ps.AddStory(WebGLContextLostFromQuantityPage( | 352 ps.AddStory(WebGLContextLostFromQuantityPage( |
| 353 ps, ps.base_dir, self.GetExpectations())) | 353 ps, ps.base_dir, self.GetExpectations())) |
| 354 ps.AddStory(WebGLContextLostFromSelectElementPage( | 354 ps.AddStory(WebGLContextLostFromSelectElementPage( |
| 355 ps, ps.base_dir, self.GetExpectations())) | 355 ps, ps.base_dir, self.GetExpectations())) |
| 356 ps.AddStory(WebGLContextLostInHiddenTabPage( | 356 ps.AddStory(WebGLContextLostInHiddenTabPage( |
| 357 ps, ps.base_dir, self.GetExpectations())) | 357 ps, ps.base_dir, self.GetExpectations())) |
| 358 return ps | 358 return ps |
| OLD | NEW |