| 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 exceptions | 7 from telemetry.core import exceptions |
| 8 from telemetry.core import util | 8 from telemetry.core import util |
| 9 from telemetry.page import page | 9 from telemetry.page import page |
| 10 from telemetry.page import page_set | 10 from telemetry.page import page_set |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 action_runner.RunAction(NavigateAction()) | 157 action_runner.RunAction(NavigateAction()) |
| 158 action_runner.RunAction(WaitAction( | 158 action_runner.RunAction(WaitAction( |
| 159 {'javascript': 'window.domAutomationController._finished'})) | 159 {'javascript': 'window.domAutomationController._finished'})) |
| 160 | 160 |
| 161 class WebGLContextLostFromQuantityPage(page.Page): | 161 class WebGLContextLostFromQuantityPage(page.Page): |
| 162 def __init__(self, page_set, base_dir): | 162 def __init__(self, page_set, base_dir): |
| 163 super(WebGLContextLostFromQuantityPage, self).__init__( | 163 super(WebGLContextLostFromQuantityPage, self).__init__( |
| 164 url='file://webgl.html?query=forced_quantity_loss', | 164 url='file://webgl.html?query=forced_quantity_loss', |
| 165 page_set=page_set, | 165 page_set=page_set, |
| 166 base_dir=base_dir) | 166 base_dir=base_dir) |
| 167 self.name = 'ContextLost.WebGLContextLostFromQuantity', | 167 self.name = 'ContextLost.WebGLContextLostFromQuantity' |
| 168 self.script_to_evaluate_on_commit = harness_script | 168 self.script_to_evaluate_on_commit = harness_script |
| 169 self.kill_gpu_process = False | 169 self.kill_gpu_process = False |
| 170 self.force_garbage_collection = True | 170 self.force_garbage_collection = True |
| 171 | 171 |
| 172 def RunNavigateSteps(self, action_runner): | 172 def RunNavigateSteps(self, action_runner): |
| 173 action_runner.RunAction(NavigateAction()) | 173 action_runner.RunAction(NavigateAction()) |
| 174 action_runner.RunAction(WaitAction( | 174 action_runner.RunAction(WaitAction( |
| 175 {'javascript': 'window.domAutomationController._loaded'})) | 175 {'javascript': 'window.domAutomationController._loaded'})) |
| 176 | 176 |
| 177 class ContextLost(test_module.Test): | 177 class ContextLost(test_module.Test): |
| 178 enabled = True | 178 enabled = True |
| 179 test = _ContextLostValidator | 179 test = _ContextLostValidator |
| 180 # For the record, this would have been another way to get the pages | 180 # For the record, this would have been another way to get the pages |
| 181 # to repeat. pageset_repeat would be another option. | 181 # to repeat. pageset_repeat would be another option. |
| 182 # options = {'page_repeat': 5} | 182 # options = {'page_repeat': 5} |
| 183 def CreatePageSet(self, options): | 183 def CreatePageSet(self, options): |
| 184 ps = page_set.PageSet( | 184 ps = page_set.PageSet( |
| 185 file_path=data_path, | 185 file_path=data_path, |
| 186 description='Test cases for real and synthetic context lost events', | 186 description='Test cases for real and synthetic context lost events', |
| 187 user_agent_type='desktop', | 187 user_agent_type='desktop', |
| 188 serving_dirs=set([''])) | 188 serving_dirs=set([''])) |
| 189 ps.AddPage(WebGLContextLostFromGPUProcessExitPage(ps, ps.base_dir)) | 189 ps.AddPage(WebGLContextLostFromGPUProcessExitPage(ps, ps.base_dir)) |
| 190 ps.AddPage(WebGLContextLostFromLoseContextExtensionPage(ps, ps.base_dir)) | 190 ps.AddPage(WebGLContextLostFromLoseContextExtensionPage(ps, ps.base_dir)) |
| 191 ps.AddPage(WebGLContextLostFromQuantityPage(ps, ps.base_dir)) | 191 ps.AddPage(WebGLContextLostFromQuantityPage(ps, ps.base_dir)) |
| 192 return ps | 192 return ps |
| 193 | 193 |
| 194 | 194 |
| OLD | NEW |