| 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 import context_lost_expectations |
| 8 | 8 |
| 9 from telemetry import benchmark as benchmark_module | 9 from telemetry import benchmark as benchmark_module |
| 10 from telemetry.core import exceptions | 10 from telemetry.core import exceptions |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 # Required for about:gpucrash handling from Telemetry. | 65 # Required for about:gpucrash handling from Telemetry. |
| 66 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 66 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
| 67 | 67 |
| 68 def ValidateAndMeasurePage(self, page, tab, results): | 68 def ValidateAndMeasurePage(self, page, tab, results): |
| 69 def WaitForPageToFinish(): | 69 def WaitForPageToFinish(): |
| 70 print "Waiting for page to finish." | 70 print "Waiting for page to finish." |
| 71 try: | 71 try: |
| 72 util.WaitFor(lambda: tab.EvaluateJavaScript( | 72 util.WaitFor(lambda: tab.EvaluateJavaScript( |
| 73 'window.domAutomationController._finished'), wait_timeout) | 73 'window.domAutomationController._finished'), wait_timeout) |
| 74 return True | 74 return True |
| 75 except util.TimeoutException: | 75 except exceptions.TimeoutException: |
| 76 return False | 76 return False |
| 77 | 77 |
| 78 if page.kill_gpu_process: | 78 if page.kill_gpu_process: |
| 79 # Doing the GPU process kill operation cooperatively -- in the | 79 # Doing the GPU process kill operation cooperatively -- in the |
| 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 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 user_agent_type='desktop', | 338 user_agent_type='desktop', |
| 339 serving_dirs=set([''])) | 339 serving_dirs=set([''])) |
| 340 ps.AddUserStory(GPUProcessCrashesExactlyOnce(ps, ps.base_dir)) | 340 ps.AddUserStory(GPUProcessCrashesExactlyOnce(ps, ps.base_dir)) |
| 341 ps.AddUserStory(WebGLContextLostFromGPUProcessExitPage(ps, ps.base_dir)) | 341 ps.AddUserStory(WebGLContextLostFromGPUProcessExitPage(ps, ps.base_dir)) |
| 342 ps.AddUserStory( | 342 ps.AddUserStory( |
| 343 WebGLContextLostFromLoseContextExtensionPage(ps, ps.base_dir)) | 343 WebGLContextLostFromLoseContextExtensionPage(ps, ps.base_dir)) |
| 344 ps.AddUserStory(WebGLContextLostFromQuantityPage(ps, ps.base_dir)) | 344 ps.AddUserStory(WebGLContextLostFromQuantityPage(ps, ps.base_dir)) |
| 345 ps.AddUserStory(WebGLContextLostFromSelectElementPage(ps, ps.base_dir)) | 345 ps.AddUserStory(WebGLContextLostFromSelectElementPage(ps, ps.base_dir)) |
| 346 ps.AddUserStory(WebGLContextLostInHiddenTabPage(ps, ps.base_dir)) | 346 ps.AddUserStory(WebGLContextLostInHiddenTabPage(ps, ps.base_dir)) |
| 347 return ps | 347 return ps |
| OLD | NEW |