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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 562 shared_page_state_class=NoTransparentVisualsShared, | 562 shared_page_state_class=NoTransparentVisualsShared, |
| 563 expectations=expectations, | 563 expectations=expectations, |
| 564 expected_workaround='disable_transparent_visuals', | 564 expected_workaround='disable_transparent_visuals', |
| 565 unexpected_workaround=None) | 565 unexpected_workaround=None) |
| 566 | 566 |
| 567 def Validate(self, tab, results): | 567 def Validate(self, tab, results): |
| 568 if sys.platform.startswith('linux'): | 568 if sys.platform.startswith('linux'): |
| 569 super(NoTransparentVisualsGpuProcessPage, self).Validate(tab, results) | 569 super(NoTransparentVisualsGpuProcessPage, self).Validate(tab, results) |
| 570 | 570 |
| 571 | 571 |
| 572 class OnlyOneWorkaroundSharedPageState(GpuProcessSharedPageState): | |
| 573 def __init__(self, test, finder_options, story_set): | |
| 574 super(OnlyOneWorkaroundSharedPageState, self).__init__( | |
| 575 test, finder_options, story_set) | |
| 576 options = finder_options.browser_options | |
| 577 options.AppendExtraBrowserArgs('--disable-gpu-driver-bug-workarounds') | |
| 578 options.AppendExtraBrowserArgs('--use_gpu_driver_workaround_for_testing') | |
| 579 | |
| 580 class OnlyOneWorkaroundPage(gpu_test_base.PageBase): | |
| 581 def __init__(self, story_set, expectations): | |
| 582 super(OnlyOneWorkaroundPage, self).__init__( | |
| 583 url='chrome:gpu', | |
| 584 name='GpuProcess.only_one_workaround', | |
| 585 page_set=story_set, | |
| 586 shared_page_state_class=OnlyOneWorkaroundSharedPageState, | |
| 587 expectations=expectations) | |
| 588 | |
| 589 def Validate(self, tab, results): | |
| 590 browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()') | |
| 591 gpu_list = tab.EvaluateJavaScript( \ | |
| 592 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()') | |
| 593 | |
| 594 if browser_list != ['use_gpu_driver_workaround_for_testing'] or \ | |
| 595 gpu_list != browser_list: | |
| 596 print 'Test failed. Printing page contents:' | |
| 597 print tab.EvaluateJavaScript('document.body.innerHTML') | |
| 598 raise page_test.Failure('Browser or GPU process lists are not reduced ' \ | |
| 599 'to only force_discrete_gpu workaround: %s != %s' % \ | |
|
Ken Russell (switch to Gerrit)
2016/08/01 21:53:50
Should this be "to only use_gpu_driver_workaround_
Julien Isorce Samsung
2016/08/02 13:12:19
Done, thx!
| |
| 600 (browser_list, gpu_list)) | |
| 601 | |
| 602 | |
| 572 class GpuProcessTestsStorySet(story_set_module.StorySet): | 603 class GpuProcessTestsStorySet(story_set_module.StorySet): |
| 573 | 604 |
| 574 """ Tests that accelerated content triggers the creation of a GPU process """ | 605 """ Tests that accelerated content triggers the creation of a GPU process """ |
| 575 | 606 |
| 576 def __init__(self, expectations, is_platform_android): | 607 def __init__(self, expectations, is_platform_android): |
| 577 super(GpuProcessTestsStorySet, self).__init__( | 608 super(GpuProcessTestsStorySet, self).__init__( |
| 578 serving_dirs=set(['../../../../content/test/data'])) | 609 serving_dirs=set(['../../../../content/test/data'])) |
| 579 | 610 |
| 580 urls_and_names_list = [ | 611 urls_and_names_list = [ |
| 581 ('file://../../data/gpu/functional_canvas_demo.html', | 612 ('file://../../data/gpu/functional_canvas_demo.html', |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 595 self.AddStory(SoftwareGpuProcessPage(self, expectations)) | 626 self.AddStory(SoftwareGpuProcessPage(self, expectations)) |
| 596 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) | 627 self.AddStory(DriverBugWorkaroundsInGpuProcessPage(self, expectations)) |
| 597 self.AddStory(IdentifyActiveGpuPage1(self, expectations)) | 628 self.AddStory(IdentifyActiveGpuPage1(self, expectations)) |
| 598 self.AddStory(IdentifyActiveGpuPage2(self, expectations)) | 629 self.AddStory(IdentifyActiveGpuPage2(self, expectations)) |
| 599 self.AddStory(IdentifyActiveGpuPage3(self, expectations)) | 630 self.AddStory(IdentifyActiveGpuPage3(self, expectations)) |
| 600 self.AddStory(IdentifyActiveGpuPage4(self, expectations)) | 631 self.AddStory(IdentifyActiveGpuPage4(self, expectations)) |
| 601 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations)) | 632 self.AddStory(ReadbackWebGLGpuProcessPage(self, expectations)) |
| 602 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations)) | 633 self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations)) |
| 603 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self, | 634 self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self, |
| 604 expectations)) | 635 expectations)) |
| 636 self.AddStory(OnlyOneWorkaroundPage(self, expectations)) | |
| 637 | |
| 605 if not is_platform_android: | 638 if not is_platform_android: |
| 606 self.AddStory(SkipGpuProcessPage(self, expectations)) | 639 self.AddStory(SkipGpuProcessPage(self, expectations)) |
| 607 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations)) | 640 self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations)) |
| 608 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations)) | 641 self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations)) |
| 609 | 642 |
| 610 @property | 643 @property |
| 611 def allow_mixed_story_states(self): | 644 def allow_mixed_story_states(self): |
| 612 # Return True here in order to be able to run pages with different browser | 645 # Return True here in order to be able to run pages with different browser |
| 613 # command line arguments. | 646 # command line arguments. |
| 614 return True | 647 return True |
| OLD | NEW |