| OLD | NEW |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 | 4 |
| 5 import sys |
| 6 |
| 5 from gpu_tests import gpu_integration_test | 7 from gpu_tests import gpu_integration_test |
| 6 import gpu_tests.hardware_accelerated_feature_expectations as hw_expectations | 8 import gpu_tests.hardware_accelerated_feature_expectations as hw_expectations |
| 7 | 9 |
| 8 test_harness_script = r""" | 10 test_harness_script = r""" |
| 9 function VerifyHardwareAccelerated(feature) { | 11 function VerifyHardwareAccelerated(feature) { |
| 10 feature += ': ' | 12 feature += ': ' |
| 11 var list = document.querySelector('.feature-status-list'); | 13 var list = document.querySelector('.feature-status-list'); |
| 12 for (var i=0; i < list.childElementCount; i++) { | 14 for (var i=0; i < list.childElementCount; i++) { |
| 13 var span_list = list.children[i].getElementsByTagName('span'); | 15 var span_list = list.children[i].getElementsByTagName('span'); |
| 14 var feature_str = span_list[0].textContent; | 16 var feature_str = span_list[0].textContent; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 (feature)) | 65 (feature)) |
| 64 | 66 |
| 65 def RunActualGpuTest(self, test_path, *args): | 67 def RunActualGpuTest(self, test_path, *args): |
| 66 feature = args[0] | 68 feature = args[0] |
| 67 self._Navigate(test_path) | 69 self._Navigate(test_path) |
| 68 tab = self.tab | 70 tab = self.tab |
| 69 if not tab.EvaluateJavaScript('VerifyHardwareAccelerated("%s")' % feature): | 71 if not tab.EvaluateJavaScript('VerifyHardwareAccelerated("%s")' % feature): |
| 70 print 'Test failed. Printing page contents:' | 72 print 'Test failed. Printing page contents:' |
| 71 print tab.EvaluateJavaScript('document.body.innerHTML') | 73 print tab.EvaluateJavaScript('document.body.innerHTML') |
| 72 self.fail('%s not hardware accelerated' % feature) | 74 self.fail('%s not hardware accelerated' % feature) |
| 75 |
| 76 def load_tests(loader, tests, pattern): |
| 77 del loader, tests, pattern # Unused. |
| 78 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) |
| OLD | NEW |