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 | 5 |
6 from telemetry import test as test_module | 6 from telemetry import test as test_module |
7 from telemetry.core import util | 7 from telemetry.core import util |
8 from telemetry.page import page_set | 8 from telemetry.page import page_set |
9 from telemetry.page import page_test | 9 from telemetry.page import page_test |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 window.domAutomationController = domAutomationController; | 38 window.domAutomationController = domAutomationController; |
39 console.log("Harness injected."); | 39 console.log("Harness injected."); |
40 """ | 40 """ |
41 | 41 |
42 class _ContextLostValidator(page_test.PageTest): | 42 class _ContextLostValidator(page_test.PageTest): |
43 def __init__(self): | 43 def __init__(self): |
44 # Strictly speaking this test doesn't yet need a browser restart | 44 # Strictly speaking this test doesn't yet need a browser restart |
45 # after each run, but if more tests are added which crash the GPU | 45 # after each run, but if more tests are added which crash the GPU |
46 # process, then it will. | 46 # process, then it will. |
47 super(_ContextLostValidator, self).__init__( | 47 super(_ContextLostValidator, self).__init__( |
48 'ValidatePage', needs_browser_restart_after_each_run=True) | 48 'ValidatePage', needs_browser_restart_after_each_page=True) |
49 | 49 |
50 def CustomizeBrowserOptions(self, options): | 50 def CustomizeBrowserOptions(self, options): |
51 options.AppendExtraBrowserArgs( | 51 options.AppendExtraBrowserArgs( |
52 '--disable-domain-blocking-for-3d-apis') | 52 '--disable-domain-blocking-for-3d-apis') |
53 # Required for about:gpucrash handling from Telemetry. | 53 # Required for about:gpucrash handling from Telemetry. |
54 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 54 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
55 | 55 |
56 def ValidatePage(self, page, tab, results): | 56 def ValidatePage(self, page, tab, results): |
57 if page.kill_gpu_process: | 57 if page.kill_gpu_process: |
58 if not tab.browser.supports_tab_control: | 58 if not tab.browser.supports_tab_control: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 'navigate_steps': [ | 106 'navigate_steps': [ |
107 { 'action': 'navigate' }, | 107 { 'action': 'navigate' }, |
108 { 'action': 'wait', | 108 { 'action': 'wait', |
109 'javascript': 'window.domAutomationController._finished' } | 109 'javascript': 'window.domAutomationController._finished' } |
110 ], | 110 ], |
111 'kill_gpu_process': False | 111 'kill_gpu_process': False |
112 }, | 112 }, |
113 ] | 113 ] |
114 } | 114 } |
115 return page_set.PageSet.FromDict(page_set_dict, data_path) | 115 return page_set.PageSet.FromDict(page_set_dict, data_path) |
OLD | NEW |