Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: content/test/gpu/page_sets/gpu_process_tests.py

Issue 2227893005: Fix a few gpu tests on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make DriverBugWorkaroundsUponGLRendererPage more robust on Android Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if len(system_info.gpu.aux_attributes['gl_renderer']) <= 0: 167 if len(system_info.gpu.aux_attributes['gl_renderer']) <= 0:
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 sys.platform in ('cygwin', 'win32'): 177 if options.browser_type.startswith('android'):
178 # Hit id 8 from kSoftwareRenderingListJson, which applies to any platform.
179 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
180 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0324')
181 elif sys.platform in ('cygwin', 'win32'):
178 # Hit id 34 from kSoftwareRenderingListJson. 182 # Hit id 34 from kSoftwareRenderingListJson.
179 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x5333') 183 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x5333')
180 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x8811') 184 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x8811')
181 elif sys.platform.startswith('linux'): 185 elif sys.platform.startswith('linux'):
182 # Hit id 50 from kSoftwareRenderingListJson. 186 # Hit id 50 from kSoftwareRenderingListJson.
183 options.AppendExtraBrowserArgs('--gpu-no-complete-info-collection') 187 options.AppendExtraBrowserArgs('--gpu-no-complete-info-collection')
184 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') 188 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
185 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') 189 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
186 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') 190 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware')
187 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=softpipe') 191 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=softpipe')
(...skipping 20 matching lines...) Expand all
208 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) 212 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js)
209 if has_gpu_process: 213 if has_gpu_process:
210 raise page_test.Failure('GPU process detected') 214 raise page_test.Failure('GPU process detected')
211 215
212 216
213 class SoftwareGpuProcessSharedPageState(GpuProcessSharedPageState): 217 class SoftwareGpuProcessSharedPageState(GpuProcessSharedPageState):
214 def __init__(self, test, finder_options, story_set): 218 def __init__(self, test, finder_options, story_set):
215 super(SoftwareGpuProcessSharedPageState, self).__init__( 219 super(SoftwareGpuProcessSharedPageState, self).__init__(
216 test, finder_options, story_set) 220 test, finder_options, story_set)
217 options = finder_options.browser_options 221 options = finder_options.browser_options
222
223 # Hit exception from id 50 from kSoftwareRenderingListJson.
218 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') 224 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
219 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') 225 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
220 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') 226 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware')
221 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=SVGA3D') 227 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=SVGA3D')
222 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=2.1 Mesa 10.1') 228 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=2.1 Mesa 10.1')
223 229
224 230
225 class SoftwareGpuProcessPage(gpu_test_base.PageBase): 231 class SoftwareGpuProcessPage(gpu_test_base.PageBase):
226 232
227 def __init__(self, story_set, expectations): 233 def __init__(self, story_set, expectations):
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 285
280 def Validate(self, tab, results): 286 def Validate(self, tab, results):
281 super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results) 287 super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results)
282 288
283 289
284 class DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState): 290 class DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState):
285 def __init__(self, test, finder_options, story_set): 291 def __init__(self, test, finder_options, story_set):
286 super(DriverBugWorkaroundsUponGLRendererShared, self).__init__( 292 super(DriverBugWorkaroundsUponGLRendererShared, self).__init__(
287 test, finder_options, story_set) 293 test, finder_options, story_set)
288 options = finder_options.browser_options 294 options = finder_options.browser_options
289 if sys.platform in ('cygwin', 'win32'): 295 if options.browser_type.startswith('android'):
296 # Hit id 108 from kGpuDriverBugListJson.
297 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=' \
298 'NVIDIA Corporation')
299 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=NVIDIA Tegra')
300 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=' \
301 'OpenGL ES 3.1 NVIDIA 343.00')
302 elif sys.platform in ('cygwin', 'win32'):
290 # Hit id 51 and 87 from kGpuDriverBugListJson. 303 # Hit id 51 and 87 from kGpuDriverBugListJson.
291 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002') 304 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002')
292 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779') 305 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779')
293 options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014') 306 options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014')
294 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.') 307 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.')
295 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \ 308 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \
296 '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)') 309 '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)')
297 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \ 310 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \
298 '(ANGLE 2.1.0.0c0d8006a9dd)') 311 '(ANGLE 2.1.0.0c0d8006a9dd)')
299 elif sys.platform.startswith('linux'): 312 elif sys.platform.startswith('linux'):
300 # Hit id 40 from kGpuDriverBugListJson. 313 # Hit id 40 from kGpuDriverBugListJson.
301 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101') 314 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101')
302 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102') 315 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102')
303 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=ARM') 316 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=ARM')
304 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Mali-400 MP') 317 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Mali-400 MP')
305 elif sys.platform == 'darwin': 318 elif sys.platform == 'darwin':
306 # Currently on osx no workaround relies on gl-renderer. 319 # Currently on osx no workaround relies on gl-renderer.
307 pass 320 pass
308 321
309 322
310 class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage): 323 class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage):
311 def __init__(self, story_set, expectations): 324 def __init__(self, story_set, expectations, is_platform_android):
312 self.expected_workaround = None 325 self.expected_workaround = None
313 self.unexpected_workaround = None 326 self.unexpected_workaround = None
314 327
315 if sys.platform in ('cygwin', 'win32'): 328 if is_platform_android:
329 self.expected_workaround = \
330 "unpack_overlapping_rows_separately_unpack_buffer"
331 elif sys.platform in ('cygwin', 'win32'):
316 self.expected_workaround = "texsubimage_faster_than_teximage" 332 self.expected_workaround = "texsubimage_faster_than_teximage"
317 self.unexpected_workaround = "disable_d3d11" 333 self.unexpected_workaround = "disable_d3d11"
318 elif sys.platform.startswith('linux'): 334 elif sys.platform.startswith('linux'):
319 self.expected_workaround = "disable_discard_framebuffer" 335 self.expected_workaround = "disable_discard_framebuffer"
320 elif sys.platform == 'darwin': 336 elif sys.platform == 'darwin':
321 pass 337 pass
322 super(DriverBugWorkaroundsUponGLRendererPage, self).__init__( 338 super(DriverBugWorkaroundsUponGLRendererPage, self).__init__(
323 name='GpuProcess.driver_bug_workarounds_upon_gl_renderer', 339 name='GpuProcess.driver_bug_workarounds_upon_gl_renderer',
324 page_set=story_set, 340 page_set=story_set,
325 shared_page_state_class=DriverBugWorkaroundsUponGLRendererShared, 341 shared_page_state_class=DriverBugWorkaroundsUponGLRendererShared,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 469
454 def Validate(self, tab, results): 470 def Validate(self, tab, results):
455 super(IdentifyActiveGpuPage4, self).Validate(tab, results) 471 super(IdentifyActiveGpuPage4, self).Validate(tab, results)
456 472
457 473
458 class ReadbackWebGLGpuProcessSharedPageState(GpuProcessSharedPageState): 474 class ReadbackWebGLGpuProcessSharedPageState(GpuProcessSharedPageState):
459 def __init__(self, test, finder_options, story_set): 475 def __init__(self, test, finder_options, story_set):
460 super(ReadbackWebGLGpuProcessSharedPageState, self).__init__( 476 super(ReadbackWebGLGpuProcessSharedPageState, self).__init__(
461 test, finder_options, story_set) 477 test, finder_options, story_set)
462 options = finder_options.browser_options 478 options = finder_options.browser_options
479 is_platform_android = options.browser_type.startswith('android')
463 480
464 if sys.platform.startswith('linux'): 481 if sys.platform.startswith('linux') and not is_platform_android:
465 # Hit id 110 from kSoftwareRenderingListJson. 482 # Hit id 110 from kSoftwareRenderingListJson.
466 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') 483 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
467 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') 484 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
468 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') 485 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware')
469 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Gallium 0.4 ' \ 486 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Gallium 0.4 ' \
470 'on llvmpipe (LLVM 3.4, 256 bits)') 487 'on llvmpipe (LLVM 3.4, 256 bits)')
471 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="3.0 Mesa 11.2"') 488 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="3.0 Mesa 11.2"')
472 489
473 class ReadbackWebGLGpuProcessPage(gpu_test_base.PageBase): 490 class ReadbackWebGLGpuProcessPage(gpu_test_base.PageBase):
474 def __init__(self, story_set, expectations): 491 def __init__(self, story_set, expectations, is_platform_android):
475 super(ReadbackWebGLGpuProcessPage, self).__init__( 492 super(ReadbackWebGLGpuProcessPage, self).__init__(
476 url='chrome:gpu', 493 url='chrome:gpu',
477 name='GpuProcess.readback_webgl_gpu_process', 494 name='GpuProcess.readback_webgl_gpu_process',
478 page_set=story_set, 495 page_set=story_set,
479 shared_page_state_class=ReadbackWebGLGpuProcessSharedPageState, 496 shared_page_state_class=ReadbackWebGLGpuProcessSharedPageState,
480 expectations=expectations) 497 expectations=expectations)
498 self.is_platform_android = is_platform_android
481 499
482 def Validate(self, tab, results): 500 def Validate(self, tab, results):
483 if sys.platform.startswith('linux'): 501 if sys.platform.startswith('linux') and not self.is_platform_android:
484 feature_status_js = 'browserBridge.gpuInfo.featureStatus.featureStatus' 502 feature_status_js = 'browserBridge.gpuInfo.featureStatus.featureStatus'
485 feature_status_list = tab.EvaluateJavaScript(feature_status_js) 503 feature_status_list = tab.EvaluateJavaScript(feature_status_js)
486 result = True 504 result = True
487 for name, status in feature_status_list.items(): 505 for name, status in feature_status_list.items():
488 if name == 'multiple_raster_threads': 506 if name == 'multiple_raster_threads':
489 result = result and status == 'enabled_on' 507 result = result and status == 'enabled_on'
490 elif name == 'native_gpu_memory_buffers': 508 elif name == 'native_gpu_memory_buffers':
491 result = result and status == 'disabled_software' 509 result = result and status == 'disabled_software'
492 elif name == 'webgl': 510 elif name == 'webgl':
493 result = result and status == 'enabled_readback' 511 result = result and status == 'enabled_readback'
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 ('file://../../data/gpu/functional_webgl.html', 603 ('file://../../data/gpu/functional_webgl.html',
586 'GpuProcess.webgl') 604 'GpuProcess.webgl')
587 ] 605 ]
588 606
589 for url, name in urls_and_names_list: 607 for url, name in urls_and_names_list:
590 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) 608 self.AddStory(GpuProcessTestsPage(url, name, self, expectations))
591 609
592 self.AddStory(FunctionalVideoPage(self, expectations)) 610 self.AddStory(FunctionalVideoPage(self, expectations))
593 self.AddStory(GpuInfoCompletePage(self, expectations)) 611 self.AddStory(GpuInfoCompletePage(self, expectations))
594 self.AddStory(NoGpuProcessPage(self, expectations)) 612 self.AddStory(NoGpuProcessPage(self, expectations))
595 self.AddStory(SoftwareGpuProcessPage(self, expectations))
596 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) 613 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations))
597 self.AddStory(IdentifyActiveGpuPage1(self, expectations)) 614 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations,
598 self.AddStory(IdentifyActiveGpuPage2(self, expectations)) 615 is_platform_android))
599 self.AddStory(IdentifyActiveGpuPage3(self, expectations)) 616 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations,
600 self.AddStory(IdentifyActiveGpuPage4(self, expectations)) 617 is_platform_android))
601 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations))
602 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations))
603 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self, 618 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self,
604 expectations)) 619 expectations))
605 if not is_platform_android: 620 if not is_platform_android:
606 self.AddStory(SkipGpuProcessPage(self, expectations)) 621 self.AddStory(SkipGpuProcessPage(self, expectations))
607 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations)) 622 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations))
608 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations)) 623 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations))
609 624
625 # There is no Android multi-gpu configuration and the helper
626 # gpu_info_collector.cc::IdentifyActiveGPU is not even called.
627 self.AddStory(IdentifyActiveGpuPage1(self, expectations))
628 self.AddStory(IdentifyActiveGpuPage2(self, expectations))
629 self.AddStory(IdentifyActiveGpuPage3(self, expectations))
630 self.AddStory(IdentifyActiveGpuPage4(self, expectations))
631
632 # There is currently no entry in kSoftwareRenderingListJson that enables
633 # a software GL driver on Android.
634 self.AddStory(SoftwareGpuProcessPage(self, expectations))
635
610 @property 636 @property
611 def allow_mixed_story_states(self): 637 def allow_mixed_story_states(self):
612 # Return True here in order to be able to run pages with different browser 638 # Return True here in order to be able to run pages with different browser
613 # command line arguments. 639 # command line arguments.
614 return True 640 return True
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_process_expectations.py ('k') | gpu/config/gpu_info_collector_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698