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

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

Issue 2232033003: Revert of Fix a few gpu tests on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 options.browser_type.startswith('android'): 177 if sys.platform in ('cygwin', 'win32'):
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'):
182 # Hit id 34 from kSoftwareRenderingListJson. 178 # Hit id 34 from kSoftwareRenderingListJson.
183 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x5333') 179 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x5333')
184 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x8811') 180 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x8811')
185 elif sys.platform.startswith('linux'): 181 elif sys.platform.startswith('linux'):
186 # Hit id 50 from kSoftwareRenderingListJson. 182 # Hit id 50 from kSoftwareRenderingListJson.
187 options.AppendExtraBrowserArgs('--gpu-no-complete-info-collection') 183 options.AppendExtraBrowserArgs('--gpu-no-complete-info-collection')
188 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') 184 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
189 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') 185 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
190 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') 186 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware')
191 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=softpipe') 187 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=softpipe')
192 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="2.1 Mesa 10.1"') 188 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="2.1 Mesa 10.1"')
193 elif sys.platform == 'darwin': 189 elif sys.platform == 'darwin':
194 # Hit id 81 from kSoftwareRenderingListJson. 190 # Hit id 81 from kSoftwareRenderingListJson.
195 options.AppendExtraBrowserArgs('--gpu-testing-os-version=10.7') 191 options.AppendExtraBrowserArgs('--gpu-testing-os-version=10.7')
196 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x15ad') 192 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x15ad')
197 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0393') 193 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0393')
198 194
199 195
200 class NoGpuProcessPage(gpu_test_base.PageBase): 196 class NoGpuProcessPage(gpu_test_base.PageBase):
201 197
202 def __init__(self, story_set, expectations, is_platform_android): 198 def __init__(self, story_set, expectations):
203 super(NoGpuProcessPage, self).__init__( 199 super(NoGpuProcessPage, self).__init__(
204 url='about:blank', 200 url='about:blank',
205 name='GpuProcess.no_gpu_process', 201 name='GpuProcess.no_gpu_process',
206 page_set=story_set, 202 page_set=story_set,
207 shared_page_state_class=NoGpuProcessSharedPageState, 203 shared_page_state_class=NoGpuProcessSharedPageState,
208 expectations=expectations) 204 expectations=expectations)
209 self.is_platform_android = is_platform_android
210 205
211 def Validate(self, tab, results): 206 def Validate(self, tab, results):
212 if self.is_platform_android:
213 return
214
215 has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()' 207 has_gpu_process_js = 'chrome.gpuBenchmarking.hasGpuProcess()'
216 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js) 208 has_gpu_process = tab.EvaluateJavaScript(has_gpu_process_js)
217 if has_gpu_process: 209 if has_gpu_process:
218 raise page_test.Failure('GPU process detected') 210 raise page_test.Failure('GPU process detected')
219 211
220 212
221 class SoftwareGpuProcessSharedPageState(GpuProcessSharedPageState): 213 class SoftwareGpuProcessSharedPageState(GpuProcessSharedPageState):
222 def __init__(self, test, finder_options, story_set): 214 def __init__(self, test, finder_options, story_set):
223 super(SoftwareGpuProcessSharedPageState, self).__init__( 215 super(SoftwareGpuProcessSharedPageState, self).__init__(
224 test, finder_options, story_set) 216 test, finder_options, story_set)
225 options = finder_options.browser_options 217 options = finder_options.browser_options
226
227 # Hit exception from id 50 from kSoftwareRenderingListJson.
228 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') 218 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
229 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') 219 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
230 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') 220 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware')
231 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=SVGA3D') 221 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=SVGA3D')
232 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=2.1 Mesa 10.1') 222 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="2.1 Mesa 10.1"')
233 223
234 224
235 class SoftwareGpuProcessPage(gpu_test_base.PageBase): 225 class SoftwareGpuProcessPage(gpu_test_base.PageBase):
236 226
237 def __init__(self, story_set, expectations): 227 def __init__(self, story_set, expectations):
238 super(SoftwareGpuProcessPage, self).__init__( 228 super(SoftwareGpuProcessPage, self).__init__(
239 url='about:blank', 229 url='about:blank',
240 name='GpuProcess.software_gpu_process', 230 name='GpuProcess.software_gpu_process',
241 page_set=story_set, 231 page_set=story_set,
242 shared_page_state_class=SoftwareGpuProcessSharedPageState, 232 shared_page_state_class=SoftwareGpuProcessSharedPageState,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 279
290 def Validate(self, tab, results): 280 def Validate(self, tab, results):
291 super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results) 281 super(DriverBugWorkaroundsInGpuProcessPage, self).Validate(tab, results)
292 282
293 283
294 class DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState): 284 class DriverBugWorkaroundsUponGLRendererShared(GpuProcessSharedPageState):
295 def __init__(self, test, finder_options, story_set): 285 def __init__(self, test, finder_options, story_set):
296 super(DriverBugWorkaroundsUponGLRendererShared, self).__init__( 286 super(DriverBugWorkaroundsUponGLRendererShared, self).__init__(
297 test, finder_options, story_set) 287 test, finder_options, story_set)
298 options = finder_options.browser_options 288 options = finder_options.browser_options
299 if options.browser_type.startswith('android'): 289 if sys.platform in ('cygwin', 'win32'):
300 # Hit id 108 from kGpuDriverBugListJson.
301 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Qualcomm')
302 elif sys.platform in ('cygwin', 'win32'):
303 # Hit id 51 and 87 from kGpuDriverBugListJson. 290 # Hit id 51 and 87 from kGpuDriverBugListJson.
304 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002') 291 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x1002')
305 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779') 292 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x6779')
306 options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014') 293 options.AppendExtraBrowserArgs('--gpu-testing-driver-date=11-20-2014')
307 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.') 294 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Google Inc.')
308 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \ 295 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=ANGLE ' \
309 '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)') 296 '(AMD Radeon HD 6450 Direct3D11 vs_5_0 ps_5_0)')
310 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \ 297 options.AppendExtraBrowserArgs('--gpu-testing-gl-version=OpenGL ES 2.0 ' \
311 '(ANGLE 2.1.0.0c0d8006a9dd)') 298 '(ANGLE 2.1.0.0c0d8006a9dd)')
312 elif sys.platform.startswith('linux'): 299 elif sys.platform.startswith('linux'):
313 # Hit id 153 from kGpuDriverBugListJson. 300 # Hit id 153 from kGpuDriverBugListJson.
314 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101') 301 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x0101')
315 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102') 302 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0102')
316 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Vivante ' \ 303 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=Vivante ' \
317 'Corporation') 304 'Corporation')
318 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Vivante GC1000') 305 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Vivante GC1000')
319 elif sys.platform == 'darwin': 306 elif sys.platform == 'darwin':
320 # Currently on osx no workaround relies on gl-renderer. 307 # Currently on osx no workaround relies on gl-renderer.
321 pass 308 pass
322 309
323 310
324 class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage): 311 class DriverBugWorkaroundsUponGLRendererPage(DriverBugWorkaroundsTestsPage):
325 def __init__(self, story_set, expectations, is_platform_android): 312 def __init__(self, story_set, expectations):
326 self.expected_workaround = None 313 self.expected_workaround = None
327 self.unexpected_workaround = None 314 self.unexpected_workaround = None
328 315
329 if is_platform_android: 316 if sys.platform in ('cygwin', 'win32'):
330 self.expected_workaround = "wake_up_gpu_before_drawing"
331 elif sys.platform in ('cygwin', 'win32'):
332 self.expected_workaround = "texsubimage_faster_than_teximage" 317 self.expected_workaround = "texsubimage_faster_than_teximage"
333 self.unexpected_workaround = "disable_d3d11" 318 self.unexpected_workaround = "disable_d3d11"
334 elif sys.platform.startswith('linux'): 319 elif sys.platform.startswith('linux'):
335 self.expected_workaround = "disable_transparent_visuals" 320 self.expected_workaround = "disable_transparent_visuals"
336 elif sys.platform == 'darwin': 321 elif sys.platform == 'darwin':
337 pass 322 pass
338 super(DriverBugWorkaroundsUponGLRendererPage, self).__init__( 323 super(DriverBugWorkaroundsUponGLRendererPage, self).__init__(
339 name='GpuProcess.driver_bug_workarounds_upon_gl_renderer', 324 name='GpuProcess.driver_bug_workarounds_upon_gl_renderer',
340 page_set=story_set, 325 page_set=story_set,
341 shared_page_state_class=DriverBugWorkaroundsUponGLRendererShared, 326 shared_page_state_class=DriverBugWorkaroundsUponGLRendererShared,
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 454
470 def Validate(self, tab, results): 455 def Validate(self, tab, results):
471 super(IdentifyActiveGpuPage4, self).Validate(tab, results) 456 super(IdentifyActiveGpuPage4, self).Validate(tab, results)
472 457
473 458
474 class ReadbackWebGLGpuProcessSharedPageState(GpuProcessSharedPageState): 459 class ReadbackWebGLGpuProcessSharedPageState(GpuProcessSharedPageState):
475 def __init__(self, test, finder_options, story_set): 460 def __init__(self, test, finder_options, story_set):
476 super(ReadbackWebGLGpuProcessSharedPageState, self).__init__( 461 super(ReadbackWebGLGpuProcessSharedPageState, self).__init__(
477 test, finder_options, story_set) 462 test, finder_options, story_set)
478 options = finder_options.browser_options 463 options = finder_options.browser_options
479 is_platform_android = options.browser_type.startswith('android')
480 464
481 if sys.platform.startswith('linux') and not is_platform_android: 465 if sys.platform.startswith('linux'):
482 # Hit id 110 from kSoftwareRenderingListJson. 466 # Hit id 110 from kSoftwareRenderingListJson.
483 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de') 467 options.AppendExtraBrowserArgs('--gpu-testing-vendor-id=0x10de')
484 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1') 468 options.AppendExtraBrowserArgs('--gpu-testing-device-id=0x0de1')
485 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware') 469 options.AppendExtraBrowserArgs('--gpu-testing-gl-vendor=VMware')
486 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Gallium 0.4 ' \ 470 options.AppendExtraBrowserArgs('--gpu-testing-gl-renderer=Gallium 0.4 ' \
487 'on llvmpipe (LLVM 3.4, 256 bits)') 471 'on llvmpipe (LLVM 3.4, 256 bits)')
488 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="3.0 Mesa 11.2"') 472 options.AppendExtraBrowserArgs('--gpu-testing-gl-version="3.0 Mesa 11.2"')
489 473
490 class ReadbackWebGLGpuProcessPage(gpu_test_base.PageBase): 474 class ReadbackWebGLGpuProcessPage(gpu_test_base.PageBase):
491 def __init__(self, story_set, expectations, is_platform_android): 475 def __init__(self, story_set, expectations):
492 super(ReadbackWebGLGpuProcessPage, self).__init__( 476 super(ReadbackWebGLGpuProcessPage, self).__init__(
493 url='chrome:gpu', 477 url='chrome:gpu',
494 name='GpuProcess.readback_webgl_gpu_process', 478 name='GpuProcess.readback_webgl_gpu_process',
495 page_set=story_set, 479 page_set=story_set,
496 shared_page_state_class=ReadbackWebGLGpuProcessSharedPageState, 480 shared_page_state_class=ReadbackWebGLGpuProcessSharedPageState,
497 expectations=expectations) 481 expectations=expectations)
498 self.is_platform_android = is_platform_android
499 482
500 def Validate(self, tab, results): 483 def Validate(self, tab, results):
501 if sys.platform.startswith('linux') and not self.is_platform_android: 484 if sys.platform.startswith('linux'):
502 feature_status_js = 'browserBridge.gpuInfo.featureStatus.featureStatus' 485 feature_status_js = 'browserBridge.gpuInfo.featureStatus.featureStatus'
503 feature_status_list = tab.EvaluateJavaScript(feature_status_js) 486 feature_status_list = tab.EvaluateJavaScript(feature_status_js)
504 result = True 487 result = True
505 for name, status in feature_status_list.items(): 488 for name, status in feature_status_list.items():
506 if name == 'multiple_raster_threads': 489 if name == 'multiple_raster_threads':
507 result = result and status == 'enabled_on' 490 result = result and status == 'enabled_on'
508 elif name == 'native_gpu_memory_buffers': 491 elif name == 'native_gpu_memory_buffers':
509 result = result and status == 'disabled_software' 492 result = result and status == 'disabled_software'
510 elif name == 'webgl': 493 elif name == 'webgl':
511 result = result and status == 'enabled_readback' 494 result = result and status == 'enabled_readback'
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 'GpuProcess.css3d'), 585 'GpuProcess.css3d'),
603 ('file://../../data/gpu/functional_webgl.html', 586 ('file://../../data/gpu/functional_webgl.html',
604 'GpuProcess.webgl') 587 'GpuProcess.webgl')
605 ] 588 ]
606 589
607 for url, name in urls_and_names_list: 590 for url, name in urls_and_names_list:
608 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) 591 self.AddStory(GpuProcessTestsPage(url, name, self, expectations))
609 592
610 self.AddStory(FunctionalVideoPage(self, expectations)) 593 self.AddStory(FunctionalVideoPage(self, expectations))
611 self.AddStory(GpuInfoCompletePage(self, expectations)) 594 self.AddStory(GpuInfoCompletePage(self, expectations))
612 self.AddStory(NoGpuProcessPage(self, expectations, is_platform_android)) 595 self.AddStory(NoGpuProcessPage(self, expectations))
596 self.AddStory(SoftwareGpuProcessPage(self, expectations))
613 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) 597 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations))
614 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations, 598 self.AddStory(IdentifyActiveGpuPage1(self, expectations))
615 is_platform_android)) 599 self.AddStory(IdentifyActiveGpuPage2(self, expectations))
616 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations, 600 self.AddStory(IdentifyActiveGpuPage3(self, expectations))
617 is_platform_android)) 601 self.AddStory(IdentifyActiveGpuPage4(self, expectations))
602 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations))
603 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations))
618 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self, 604 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self,
619 expectations)) 605 expectations))
620 if not is_platform_android: 606 if not is_platform_android:
621 self.AddStory(SkipGpuProcessPage(self, expectations)) 607 self.AddStory(SkipGpuProcessPage(self, expectations))
622 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations)) 608 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations))
623 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations)) 609 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations))
624 610
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
636 @property 611 @property
637 def allow_mixed_story_states(self): 612 def allow_mixed_story_states(self):
638 # Return True here in order to be able to run pages with different browser 613 # Return True here in order to be able to run pages with different browser
639 # command line arguments. 614 # command line arguments.
640 return True 615 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