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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 raise page_test.Failure('Must have a non-empty gl_renderer string') | 168 raise page_test.Failure('Must have a non-empty gl_renderer string') |
169 | 169 |
170 | 170 |
171 class NoGpuProcessSharedPageState(GpuProcessSharedPageState): | 171 class NoGpuProcessSharedPageState(GpuProcessSharedPageState): |
172 def __init__(self, test, finder_options, story_set): | 172 def __init__(self, test, finder_options, story_set): |
173 super(NoGpuProcessSharedPageState, self).__init__( | 173 super(NoGpuProcessSharedPageState, self).__init__( |
174 test, finder_options, story_set) | 174 test, finder_options, story_set) |
175 options = finder_options.browser_options | 175 options = finder_options.browser_options |
176 | 176 |
177 if options.browser_type.startswith('android'): | 177 if options.browser_type.startswith('android'): |
178 # There is currently no entry in kSoftwareRenderingListJson that disables | 178 # Hit id 8 from kSoftwareRenderingListJson, which applies to any platform. |
179 # all gpu features on Android. | 179 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') |
180 pass | 180 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0324') |
Julien Isorce Samsung
2016/08/10 12:54:55
I made this test work on Android while I was at it
| |
181 elif sys.platform in ('cygwin', 'win32'): | 181 elif sys.platform in ('cygwin', 'win32'): |
182 # Hit id 34 from kSoftwareRenderingListJson. | 182 # Hit id 34 from kSoftwareRenderingListJson. |
183 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x5333') | 183 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x5333') |
184 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x8811') | 184 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x8811') |
185 elif sys.platform.startswith('linux'): | 185 elif sys.platform.startswith('linux'): |
186 # Hit id 50 from kSoftwareRenderingListJson. | 186 # Hit id 50 from kSoftwareRenderingListJson. |
187 options.AppendExtraBrowserArgs('--gpu-no-complete-info-collection') | 187 options.AppendExtraBrowserArgs('--gpu-no-complete-info-collection') |
188 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') | 188 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') |
189 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') | 189 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') |
190 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') | 190 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') |
(...skipping 21 matching lines...) Expand all Loading... | |
212 if self.is_platform_android: | 212 if self.is_platform_android: |
213 return | 213 return |
214 | 214 |
215 has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()' | 215 has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()' |
216 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) | 216 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) |
217 if has_gpu_process: | 217 if has_gpu_process: |
218 raise page_test.Failure('GPU process detected') | 218 raise page_test.Failure('GPU process detected') |
219 | 219 |
220 | 220 |
221 class SoftwareGpuProcessSharedPageState(GpuProcessSharedPageState): | 221 class SoftwareGpuProcessSharedPageState(GpuProcessSharedPageState): |
222 | |
222 def __init__(self, test, finder_options, story_set): | 223 def __init__(self, test, finder_options, story_set): |
223 super(SoftwareGpuProcessSharedPageState, self).__init__( | 224 super(SoftwareGpuProcessSharedPageState, self).__init__( |
224 test, finder_options, story_set) | 225 test, finder_options, story_set) |
225 options = finder_options.browser_options | 226 options = finder_options.browser_options |
227 | |
228 # Hit exception from id 50 from kSoftwareRenderingListJson. | |
226 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') | 229 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') |
227 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') | 230 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') |
228 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') | 231 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') |
229 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=SVGA3D') | 232 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=SVGA3D') |
230 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="2.1 Mesa 10.1"') | 233 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=2.1 Mesa 10.1') |
231 | 234 |
Julien Isorce Samsung
2016/08/10 12:54:55
Cosmetic change.
| |
232 | 235 |
233 class SoftwareGpuProcessPage(gpu_test_base.PageBase): | 236 class SoftwareGpuProcessPage(gpu_test_base.PageBase): |
234 | 237 |
235 def __init__(self, story_set, expectations): | 238 def __init__(self, story_set, expectations): |
236 super(SoftwareGpuProcessPage, self).__init__( | 239 super(SoftwareGpuProcessPage, self).__init__( |
237 url='about:blank', | 240 url='about:blank', |
238 name='GpuProcess.software_gpu_process', | 241 name='GpuProcess.software_gpu_process', |
239 page_set=story_set, | 242 page_set=story_set, |
240 shared_page_state_class=SoftwareGpuProcessSharedPageState, | 243 shared_page_state_class=SoftwareGpuProcessSharedPageState, |
241 expectations=expectations) | 244 expectations=expectations) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results) | 292 super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results) |
290 | 293 |
291 | 294 |
292 class DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState): | 295 class DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState): |
293 def __init__(self, test, finder_options, story_set): | 296 def __init__(self, test, finder_options, story_set): |
294 super(DriverBugWorkaroundsUponGLRendererShared, self).__init__( | 297 super(DriverBugWorkaroundsUponGLRendererShared, self).__init__( |
295 test, finder_options, story_set) | 298 test, finder_options, story_set) |
296 options = finder_options.browser_options | 299 options = finder_options.browser_options |
297 if options.browser_type.startswith('android'): | 300 if options.browser_type.startswith('android'): |
298 # Hit id 108 from kGpuDriverBugListJson. | 301 # Hit id 108 from kGpuDriverBugListJson. |
299 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=ARM') | 302 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Qualcomm') |
Julien Isorce Samsung
2016/08/10 12:54:55
This fixes one of the 3 issues that lead to revert
| |
300 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Mali-400') | |
301 elif sys.platform in ('cygwin', 'win32'): | 303 elif sys.platform in ('cygwin', 'win32'): |
302 # Hit id 51 and 87 from kGpuDriverBugListJson. | 304 # Hit id 51 and 87 from kGpuDriverBugListJson. |
303 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002') | 305 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002') |
304 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779') | 306 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779') |
305 options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014') | 307 options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014') |
306 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.') | 308 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.') |
307 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \ | 309 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \ |
308 '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)') | 310 '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)') |
309 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \ | 311 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \ |
310 '(ANGLE 2.1.0.0c0d8006a9dd)') | 312 '(ANGLE 2.1.0.0c0d8006a9dd)') |
311 elif sys.platform.startswith('linux'): | 313 elif sys.platform.startswith('linux'): |
312 # Hit id 153 from kGpuDriverBugListJson. | 314 # Hit id 153 from kGpuDriverBugListJson. |
313 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101') | 315 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101') |
314 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102') | 316 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102') |
315 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Vivante ' \ | 317 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Vivante ' \ |
316 'Corporation') | 318 'Corporation') |
317 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Vivante GC1000') | 319 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Vivante GC1000') |
318 elif sys.platform == 'darwin': | 320 elif sys.platform == 'darwin': |
319 # Currently on osx no workaround relies on gl-renderer. | 321 # Currently on osx no workaround relies on gl-renderer. |
320 pass | 322 pass |
321 | 323 |
322 | 324 |
323 class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage): | 325 class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage): |
324 def __init__(self, story_set, expectations, is_platform_android): | 326 def __init__(self, story_set, expectations, is_platform_android): |
325 self.expected_workaround = None | 327 self.expected_workaround = None |
326 self.unexpected_workaround = None | 328 self.unexpected_workaround = None |
327 | 329 |
328 if is_platform_android: | 330 if is_platform_android: |
329 self.expected_workaround = "disable_gl_rgb_format" | 331 self.expected_workaround = "wake_up_gpu_before_drawing" |
330 elif sys.platform in ('cygwin', 'win32'): | 332 elif sys.platform in ('cygwin', 'win32'): |
331 self.expected_workaround = "texsubimage_faster_than_teximage" | 333 self.expected_workaround = "texsubimage_faster_than_teximage" |
332 self.unexpected_workaround = "disable_d3d11" | 334 self.unexpected_workaround = "disable_d3d11" |
333 elif sys.platform.startswith('linux'): | 335 elif sys.platform.startswith('linux'): |
334 self.expected_workaround = "disable_transparent_visuals" | 336 self.expected_workaround = "disable_transparent_visuals" |
335 elif sys.platform == 'darwin': | 337 elif sys.platform == 'darwin': |
336 pass | 338 pass |
337 super(DriverBugWorkaroundsUponGLRendererPage, self).__init__( | 339 super(DriverBugWorkaroundsUponGLRendererPage, self).__init__( |
338 name='GpuProcess.driver_bug_workarounds_upon_gl_renderer', | 340 name='GpuProcess.driver_bug_workarounds_upon_gl_renderer', |
339 page_set=story_set, | 341 page_set=story_set, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
468 | 470 |
469 def Validate(self, tab, results): | 471 def Validate(self, tab, results): |
470 super(IdentifyActiveGpuPage4, self).Validate(tab, results) | 472 super(IdentifyActiveGpuPage4, self).Validate(tab, results) |
471 | 473 |
472 | 474 |
473 class ReadbackWebGLGpuProcessSharedPageState(GpuProcessSharedPageState): | 475 class ReadbackWebGLGpuProcessSharedPageState(GpuProcessSharedPageState): |
474 def __init__(self, test, finder_options, story_set): | 476 def __init__(self, test, finder_options, story_set): |
475 super(ReadbackWebGLGpuProcessSharedPageState, self).__init__( | 477 super(ReadbackWebGLGpuProcessSharedPageState, self).__init__( |
476 test, finder_options, story_set) | 478 test, finder_options, story_set) |
477 options = finder_options.browser_options | 479 options = finder_options.browser_options |
480 is_platform_android = options.browser_type.startswith('android') | |
478 | 481 |
479 if sys.platform.startswith('linux'): | 482 if sys.platform.startswith('linux') and not is_platform_android: |
Julien Isorce Samsung
2016/08/10 12:54:55
Fixes one of the 3 issues that caused a revert. I
| |
480 # Hit id 110 from kSoftwareRenderingListJson. | 483 # Hit id 110 from kSoftwareRenderingListJson. |
481 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') | 484 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') |
482 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') | 485 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') |
483 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') | 486 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') |
484 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Gallium 0.4 ' \ | 487 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Gallium 0.4 ' \ |
485 'on llvmpipe (LLVM 3.4, 256 bits)') | 488 'on llvmpipe (LLVM 3.4, 256 bits)') |
486 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="3.0 Mesa 11.2"') | 489 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="3.0 Mesa 11.2"') |
487 | 490 |
488 class ReadbackWebGLGpuProcessPage(gpu_test_base.PageBase): | 491 class ReadbackWebGLGpuProcessPage(gpu_test_base.PageBase): |
489 def __init__(self, story_set, expectations, is_platform_android): | 492 def __init__(self, story_set, expectations, is_platform_android): |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 ('file://../../data/gpu/functional_webgl.html', | 604 ('file://../../data/gpu/functional_webgl.html', |
602 'GpuProcess.webgl') | 605 'GpuProcess.webgl') |
603 ] | 606 ] |
604 | 607 |
605 for url, name in urls_and_names_list: | 608 for url, name in urls_and_names_list: |
606 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) | 609 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) |
607 | 610 |
608 self.AddStory(FunctionalVideoPage(self, expectations)) | 611 self.AddStory(FunctionalVideoPage(self, expectations)) |
609 self.AddStory(GpuInfoCompletePage(self, expectations)) | 612 self.AddStory(GpuInfoCompletePage(self, expectations)) |
610 self.AddStory(NoGpuProcessPage(self, expectations, is_platform_android)) | 613 self.AddStory(NoGpuProcessPage(self, expectations, is_platform_android)) |
611 self.AddStory(SoftwareGpuProcessPage(self, expectations)) | |
612 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) | 614 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) |
613 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations, | 615 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations, |
614 is_platform_android)) | 616 is_platform_android)) |
615 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations, | 617 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations, |
616 is_platform_android)) | 618 is_platform_android)) |
617 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self, | 619 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self, |
618 expectations)) | 620 expectations)) |
619 if not is_platform_android: | 621 if not is_platform_android: |
620 self.AddStory(SkipGpuProcessPage(self, expectations)) | 622 self.AddStory(SkipGpuProcessPage(self, expectations)) |
621 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations)) | 623 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations)) |
622 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations)) | 624 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations)) |
623 | 625 |
624 # There is no Android multi-gpu configuration and the helper | 626 # There is no Android multi-gpu configuration and the helper |
625 # gpu_info_collector.cc::IdentifyActiveGPU is not even called. | 627 # gpu_info_collector.cc::IdentifyActiveGPU is not even called. |
626 self.AddStory(IdentifyActiveGpuPage1(self, expectations)) | 628 self.AddStory(IdentifyActiveGpuPage1(self, expectations)) |
627 self.AddStory(IdentifyActiveGpuPage2(self, expectations)) | 629 self.AddStory(IdentifyActiveGpuPage2(self, expectations)) |
628 self.AddStory(IdentifyActiveGpuPage3(self, expectations)) | 630 self.AddStory(IdentifyActiveGpuPage3(self, expectations)) |
629 self.AddStory(IdentifyActiveGpuPage4(self, expectations)) | 631 self.AddStory(IdentifyActiveGpuPage4(self, expectations)) |
630 | 632 |
633 # There is currently no entry in kSoftwareRenderingListJson that enables | |
634 # a software GL driver on Android. | |
635 self.AddStory(SoftwareGpuProcessPage(self, expectations)) | |
Julien Isorce Samsung
2016/08/10 12:54:55
Fixes one of the 3 issues that caused a revert. Se
| |
636 | |
631 @property | 637 @property |
632 def allow_mixed_story_states(self): | 638 def allow_mixed_story_states(self): |
633 # Return True here in order to be able to run pages with different browser | 639 # Return True here in order to be able to run pages with different browser |
634 # command line arguments. | 640 # command line arguments. |
635 return True | 641 return True |
OLD | NEW |