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

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

Issue 1982323003: Add EqualBugWorkaroundsInBrowserAndGpuProcessPage to gpu_process_test.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebase Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 elif name == 'native_gpu_memory_buffers': 491 elif name == 'native_gpu_memory_buffers':
492 result = result and status == 'disabled_software' 492 result = result and status == 'disabled_software'
493 elif name == 'webgl': 493 elif name == 'webgl':
494 result = result and status == 'enabled_readback' 494 result = result and status == 'enabled_readback'
495 else: 495 else:
496 result = result and status == 'unavailable_software' 496 result = result and status == 'unavailable_software'
497 if not result: 497 if not result:
498 raise page_test.Failure('WebGL readback setup failed: %s' \ 498 raise page_test.Failure('WebGL readback setup failed: %s' \
499 % feature_status_list) 499 % feature_status_list)
500 500
501
502 class EqualBugWorkaroundsInBrowserAndGpuProcessPage(gpu_test_base.PageBase):
503 def __init__(self, story_set, expectations):
504 super(EqualBugWorkaroundsInBrowserAndGpuProcessPage, self).__init__(
505 url='chrome:gpu',
506 name='GpuProcess.equal_bug_workarounds_in_browser_and_gpu_process',
507 page_set=story_set,
508 shared_page_state_class=GpuProcessSharedPageState,
509 expectations=expectations)
510
511 def Validate(self, tab, results):
512 browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()')
513 gpu_list = tab.EvaluateJavaScript( \
514 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()')
515
516 diff = set(browser_list).symmetric_difference(set(gpu_list))
517 if len(diff) > 0:
518 print 'Test failed. Printing page contents:'
519 print tab.EvaluateJavaScript('document.body.innerHTML')
520 raise page_test.Failure('Browser and GPU process list of driver bug' \
521 'workarounds are not equal: %s != %s, diff: %s' % \
522 (browser_list, gpu_list, list(diff)))
523
524
501 class GpuProcessTestsStorySet(story_set_module.StorySet): 525 class GpuProcessTestsStorySet(story_set_module.StorySet):
502 526
503 """ Tests that accelerated content triggers the creation of a GPU process """ 527 """ Tests that accelerated content triggers the creation of a GPU process """
504 528
505 def __init__(self, expectations, is_platform_android): 529 def __init__(self, expectations, is_platform_android):
506 super(GpuProcessTestsStorySet, self).__init__( 530 super(GpuProcessTestsStorySet, self).__init__(
507 serving_dirs=set(['../../../../content/test/data'])) 531 serving_dirs=set(['../../../../content/test/data']))
508 532
509 urls_and_names_list = [ 533 urls_and_names_list = [
510 ('file://../../data/gpu/functional_canvas_demo.html', 534 ('file://../../data/gpu/functional_canvas_demo.html',
(...skipping 13 matching lines...) Expand all
524 self.AddStory(SoftwareGpuProcessPage(self, expectations)) 548 self.AddStory(SoftwareGpuProcessPage(self, expectations))
525 if not is_platform_android: 549 if not is_platform_android:
526 self.AddStory(SkipGpuProcessPage(self, expectations)) 550 self.AddStory(SkipGpuProcessPage(self, expectations))
527 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) 551 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations))
528 self.AddStory(IdentifyActiveGpuPage1(self, expectations)) 552 self.AddStory(IdentifyActiveGpuPage1(self, expectations))
529 self.AddStory(IdentifyActiveGpuPage2(self, expectations)) 553 self.AddStory(IdentifyActiveGpuPage2(self, expectations))
530 self.AddStory(IdentifyActiveGpuPage3(self, expectations)) 554 self.AddStory(IdentifyActiveGpuPage3(self, expectations))
531 self.AddStory(IdentifyActiveGpuPage4(self, expectations)) 555 self.AddStory(IdentifyActiveGpuPage4(self, expectations))
532 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations)) 556 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations))
533 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations)) 557 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations))
558 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self,
559 expectations))
534 560
535 @property 561 @property
536 def allow_mixed_story_states(self): 562 def allow_mixed_story_states(self):
537 # Return True here in order to be able to run pages with different browser 563 # Return True here in order to be able to run pages with different browser
538 # command line arguments. 564 # command line arguments.
539 return True 565 return True
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698