| 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 |
| 11 # A list of exceptional driver bug workarounds allowed to be present |
| 12 # during some of the tests that ensure that the browser's and GPU |
| 13 # process's notions of the driver bug workarounds are equivalent. |
| 14 workaround_exceptions = set([u'decode_encode_srgb_for_generatemipmap']) |
| 15 |
| 16 |
| 10 class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState): | 17 class GpuProcessSharedPageState(gpu_test_base.GpuSharedPageState): |
| 11 | 18 |
| 12 gpu_switches = ['--gpu-no-complete-info-collection', | 19 gpu_switches = ['--gpu-no-complete-info-collection', |
| 13 '--gpu-testing-os-version', | 20 '--gpu-testing-os-version', |
| 14 '--gpu-testing-vendor-id', | 21 '--gpu-testing-vendor-id', |
| 15 '--gpu-testing-device-id', | 22 '--gpu-testing-device-id', |
| 16 '--gpu-testing-secondary-vendor-ids', | 23 '--gpu-testing-secondary-vendor-ids', |
| 17 '--gpu-testing-secondary-device-ids', | 24 '--gpu-testing-secondary-device-ids', |
| 18 '--gpu-testing-driver-date', | 25 '--gpu-testing-driver-date', |
| 19 '--gpu-testing-gl-vendor', | 26 '--gpu-testing-gl-vendor', |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 145 |
| 139 has_gpu_channel_js = 'chrome.gpuBenchmarking.hasGpuChannel()' | 146 has_gpu_channel_js = 'chrome.gpuBenchmarking.hasGpuChannel()' |
| 140 if not tab.EvaluateJavaScript(has_gpu_channel_js): | 147 if not tab.EvaluateJavaScript(has_gpu_channel_js): |
| 141 raise page_test.Failure('No GPU channel detected') | 148 raise page_test.Failure('No GPU channel detected') |
| 142 | 149 |
| 143 browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()') | 150 browser_list = tab.EvaluateJavaScript('GetDriverBugWorkarounds()') |
| 144 gpu_list = tab.EvaluateJavaScript( \ | 151 gpu_list = tab.EvaluateJavaScript( \ |
| 145 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()') | 152 'chrome.gpuBenchmarking.getGpuDriverBugWorkarounds()') |
| 146 | 153 |
| 147 diff = set(browser_list).symmetric_difference(set(gpu_list)) | 154 diff = set(browser_list).symmetric_difference(set(gpu_list)) |
| 148 if len(diff) > 0: | 155 if not diff.issubset(workaround_exceptions): |
| 149 print 'Test failed. Printing page contents:' | 156 print 'Test failed. Printing page contents:' |
| 150 print tab.EvaluateJavaScript('document.body.innerHTML') | 157 print tab.EvaluateJavaScript('document.body.innerHTML') |
| 151 raise page_test.Failure('Browser and GPU process list of driver bug' \ | 158 raise page_test.Failure('Browser and GPU process list of driver bug' \ |
| 152 'workarounds are not equal: %s != %s, diff: %s' % \ | 159 'workarounds are not equal: %s != %s, diff: %s' % \ |
| 153 (browser_list, gpu_list, list(diff))) | 160 (browser_list, gpu_list, list(diff))) |
| 154 | 161 |
| 155 basic_infos = tab.EvaluateJavaScript('browserBridge.gpuInfo.basic_info') | 162 basic_infos = tab.EvaluateJavaScript('browserBridge.gpuInfo.basic_info') |
| 156 disabled_gl_extensions = None | 163 disabled_gl_extensions = None |
| 157 for info in basic_infos: | 164 for info in basic_infos: |
| 158 if info['description'].startswith('Disabled Extensions'): | 165 if info['description'].startswith('Disabled Extensions'): |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 def Validate(self, tab, results): | 703 def Validate(self, tab, results): |
| 697 # Requires EqualBugWorkaroundsPage to succeed. If it has failed then just | 704 # Requires EqualBugWorkaroundsPage to succeed. If it has failed then just |
| 698 # pass to not overload the logs. | 705 # pass to not overload the logs. |
| 699 if self.expected_workarounds is None: | 706 if self.expected_workarounds is None: |
| 700 return | 707 return |
| 701 | 708 |
| 702 recorded_info = super(OnlyOneWorkaroundPage, self).Validate(tab, results) | 709 recorded_info = super(OnlyOneWorkaroundPage, self).Validate(tab, results) |
| 703 gpu_list, disabled_gl_extensions = recorded_info | 710 gpu_list, disabled_gl_extensions = recorded_info |
| 704 | 711 |
| 705 diff = set(self.expected_workarounds).symmetric_difference(set(gpu_list)) | 712 diff = set(self.expected_workarounds).symmetric_difference(set(gpu_list)) |
| 706 if len(diff) > 0: | 713 if not diff.issubset(workaround_exceptions): |
| 707 print 'Test failed. Printing page contents:' | 714 print 'Test failed. Printing page contents:' |
| 708 print tab.EvaluateJavaScript('document.body.innerHTML') | 715 print tab.EvaluateJavaScript('document.body.innerHTML') |
| 709 raise page_test.Failure('GPU process and expected list of driver bug' \ | 716 raise page_test.Failure('GPU process and expected list of driver bug' \ |
| 710 'workarounds are not equal: %s != %s, diff: %s' % \ | 717 'workarounds are not equal: %s != %s, diff: %s' % \ |
| 711 (self.expected_workarounds, gpu_list, list(diff))) | 718 (self.expected_workarounds, gpu_list, list(diff))) |
| 712 | 719 |
| 713 if self.expected_disabled_exts != disabled_gl_extensions: | 720 if self.expected_disabled_exts != disabled_gl_extensions: |
| 714 print 'Test failed. Printing page contents:' | 721 print 'Test failed. Printing page contents:' |
| 715 print tab.EvaluateJavaScript('document.body.innerHTML') | 722 print tab.EvaluateJavaScript('document.body.innerHTML') |
| 716 raise page_test.Failure('The expected disabled gl extensions are ' \ | 723 raise page_test.Failure('The expected disabled gl extensions are ' \ |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 770 |
| 764 # There is currently no entry in kSoftwareRenderingListJson that enables | 771 # There is currently no entry in kSoftwareRenderingListJson that enables |
| 765 # a software GL driver on Android. | 772 # a software GL driver on Android. |
| 766 self.AddStory(SoftwareGpuProcessPage(self, expectations)) | 773 self.AddStory(SoftwareGpuProcessPage(self, expectations)) |
| 767 | 774 |
| 768 @property | 775 @property |
| 769 def allow_mixed_story_states(self): | 776 def allow_mixed_story_states(self): |
| 770 # Return True here in order to be able to run pages with different browser | 777 # Return True here in order to be able to run pages with different browser |
| 771 # command line arguments. | 778 # command line arguments. |
| 772 return True | 779 return True |
| OLD | NEW |