Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 sys | 4 import sys |
| 5 from telemetry.story import story_set as story_set_module | 5 from telemetry.story import story_set as story_set_module |
| 6 from telemetry.page import page_test | 6 from telemetry.page import page_test |
| 7 | 7 |
| 8 from gpu_tests import gpu_test_base | 8 from gpu_tests import gpu_test_base |
| 9 | 9 |
| 10 class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState): | 10 class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState): |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 page_set=story_set, | 162 page_set=story_set, |
| 163 shared_page_state_class=SkipGpuProcessSharedPageState, | 163 shared_page_state_class=SkipGpuProcessSharedPageState, |
| 164 expectations=expectations) | 164 expectations=expectations) |
| 165 | 165 |
| 166 def Validate(self, tab, results): | 166 def Validate(self, tab, results): |
| 167 has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()' | 167 has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()' |
| 168 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) | 168 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) |
| 169 if has_gpu_process: | 169 if has_gpu_process: |
| 170 raise page_test.Failure('GPU process detected') | 170 raise page_test.Failure('GPU process detected') |
| 171 | 171 |
| 172 | |
| 173 class DriverBugWorkaroundsSharedPageState(GpuProcessSharedPageState): | |
| 174 def __init__(self, test, finder_options, story_set): | |
| 175 super(DriverBugWorkaroundsSharedPageState, self).__init__( | |
| 176 test, finder_options, story_set) | |
| 177 options = finder_options.browser_options | |
| 178 options.AppendExtraBrowserArgs('--use_testing_gpu_driver_workaround') | |
|
Ken Russell (switch to Gerrit)
2016/03/30 22:17:42
Update per naming nit below.
Julien Isorce Samsung
2016/03/31 15:20:09
Done.
| |
| 179 | |
| 180 | |
| 181 class DriverBugWorkaroundsGpuProcessPage(gpu_test_base.PageBase): | |
|
Ken Russell (switch to Gerrit)
2016/03/30 22:17:41
nit: DriverBugWorkaroundsInGpuProcessPage
Julien Isorce Samsung
2016/03/31 15:20:09
Done.
| |
| 182 def __init__(self, story_set, expectations): | |
| 183 super(DriverBugWorkaroundsGpuProcessPage, self).__init__( | |
| 184 url='chrome:gpu', | |
| 185 name='GpuProcess.driver_bug_workarounds_gpu_process', | |
|
Ken Russell (switch to Gerrit)
2016/03/30 22:17:41
nit: driver_bug_workarounds_in_gpu_process
Julien Isorce Samsung
2016/03/31 15:20:09
Done.
| |
| 186 page_set=story_set, | |
| 187 shared_page_state_class=DriverBugWorkaroundsSharedPageState, | |
| 188 expectations=expectations) | |
| 189 | |
| 190 def Validate(self, tab, results): | |
| 191 if not tab.EvaluateJavaScript('VerifyDriverBugWorkarounds("%s")' | |
| 192 % 'use_testing_gpu_driver_workaround'): | |
|
Ken Russell (switch to Gerrit)
2016/03/30 22:17:41
Update name.
Julien Isorce Samsung
2016/03/31 15:20:09
Done.
| |
| 193 print 'Test failed. Printing page contents:' | |
| 194 print tab.EvaluateJavaScript('document.body.innerHTML') | |
| 195 raise page_test.Failure('browser and gpu process list of driver bug \ | |
|
Ken Russell (switch to Gerrit)
2016/03/30 22:17:42
Grammar nit:
"Browser\'s and GPU process\'s lists
Julien Isorce Samsung
2016/03/31 15:20:09
Done.
| |
| 196 workarounds are not equals') | |
|
Ken Russell (switch to Gerrit)
2016/03/30 22:17:41
Is this really what this test verifies -- that the
Julien Isorce Samsung
2016/03/31 15:20:09
Let me explain why I think it does, but maybe I am
| |
| 197 | |
| 198 | |
| 172 class GpuProcessTestsStorySet(story_set_module.StorySet): | 199 class GpuProcessTestsStorySet(story_set_module.StorySet): |
| 173 | 200 |
| 174 """ Tests that accelerated content triggers the creation of a GPU process """ | 201 """ Tests that accelerated content triggers the creation of a GPU process """ |
| 175 | 202 |
| 176 def __init__(self, expectations): | 203 def __init__(self, expectations): |
| 177 super(GpuProcessTestsStorySet, self).__init__( | 204 super(GpuProcessTestsStorySet, self).__init__( |
| 178 serving_dirs=set(['../../../../content/test/data'])) | 205 serving_dirs=set(['../../../../content/test/data'])) |
| 179 | 206 |
| 180 urls_and_names_list = [ | 207 urls_and_names_list = [ |
| 181 ('file://../../data/gpu/functional_canvas_demo.html', | 208 ('file://../../data/gpu/functional_canvas_demo.html', |
| 182 'GpuProcess.canvas2d'), | 209 'GpuProcess.canvas2d'), |
| 183 ('file://../../data/gpu/functional_3d_css.html', | 210 ('file://../../data/gpu/functional_3d_css.html', |
| 184 'GpuProcess.css3d'), | 211 'GpuProcess.css3d'), |
| 185 ('file://../../data/gpu/functional_webgl.html', | 212 ('file://../../data/gpu/functional_webgl.html', |
| 186 'GpuProcess.webgl') | 213 'GpuProcess.webgl') |
| 187 ] | 214 ] |
| 188 | 215 |
| 189 for url, name in urls_and_names_list: | 216 for url, name in urls_and_names_list: |
| 190 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) | 217 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) |
| 191 | 218 |
| 192 self.AddStory(FunctionalVideoPage(self, expectations)) | 219 self.AddStory(FunctionalVideoPage(self, expectations)) |
| 193 self.AddStory(GpuInfoCompletePage(self, expectations)) | 220 self.AddStory(GpuInfoCompletePage(self, expectations)) |
| 194 self.AddStory(NoGpuProcessPage(self, expectations)) | 221 self.AddStory(NoGpuProcessPage(self, expectations)) |
| 195 self.AddStory(SoftwareGpuProcessPage(self, expectations)) | 222 self.AddStory(SoftwareGpuProcessPage(self, expectations)) |
| 196 self.AddStory(SkipGpuProcessPage(self, expectations)) | 223 self.AddStory(SkipGpuProcessPage(self, expectations)) |
| 224 self.AddStory(DriverBugWorkaroundsGpuProcessPage(self, expectations)) | |
| 197 | 225 |
| 198 @property | 226 @property |
| 199 def allow_mixed_story_states(self): | 227 def allow_mixed_story_states(self): |
| 200 # Return True here in order to be able to run pages with different browser | 228 # Return True here in order to be able to run pages with different browser |
| 201 # command line arguments. | 229 # command line arguments. |
| 202 return True | 230 return True |
| OLD | NEW |