| 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 | 5 import sys |
| 6 | 6 |
| 7 from gpu_tests import gpu_integration_test | 7 from gpu_tests import gpu_integration_test |
| 8 import gpu_tests.hardware_accelerated_feature_expectations as hw_expectations | 8 import gpu_tests.hardware_accelerated_feature_expectations as hw_expectations |
| 9 | 9 |
| 10 test_harness_script = r""" | 10 test_harness_script = r""" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class HardwareAcceleratedFeatureIntegrationTest( | 30 class HardwareAcceleratedFeatureIntegrationTest( |
| 31 gpu_integration_test.GpuIntegrationTest): | 31 gpu_integration_test.GpuIntegrationTest): |
| 32 """Tests GPU acceleration is reported as active for various features.""" | 32 """Tests GPU acceleration is reported as active for various features.""" |
| 33 | 33 |
| 34 @classmethod | 34 @classmethod |
| 35 def Name(cls): | 35 def Name(cls): |
| 36 """The name by which this test is invoked on the command line.""" | 36 """The name by which this test is invoked on the command line.""" |
| 37 return 'hardware_accelerated_feature' | 37 return 'hardware_accelerated_feature' |
| 38 | 38 |
| 39 @classmethod | 39 @classmethod |
| 40 def setUpClass(cls): | 40 def SetUpProcess(cls): |
| 41 super(cls, HardwareAcceleratedFeatureIntegrationTest).setUpClass() | 41 super(cls, HardwareAcceleratedFeatureIntegrationTest).SetUpProcess() |
| 42 cls.SetBrowserOptions(cls._finder_options) | 42 cls.SetBrowserOptions(cls._finder_options) |
| 43 cls.StartBrowser() | 43 cls.StartBrowser() |
| 44 cls.SetStaticServerDirs([]) | 44 cls.SetStaticServerDirs([]) |
| 45 | 45 |
| 46 @classmethod | 46 @classmethod |
| 47 def _CreateExpectations(cls): | 47 def _CreateExpectations(cls): |
| 48 return hw_expectations.HardwareAcceleratedFeatureExpectations() | 48 return hw_expectations.HardwareAcceleratedFeatureExpectations() |
| 49 | 49 |
| 50 def _Navigate(self, url): | 50 def _Navigate(self, url): |
| 51 # It's crucial to use the action_runner, rather than the tab's | 51 # It's crucial to use the action_runner, rather than the tab's |
| (...skipping 18 matching lines...) Expand all Loading... |
| 70 tab = self.tab | 70 tab = self.tab |
| 71 if not tab.EvaluateJavaScript2( | 71 if not tab.EvaluateJavaScript2( |
| 72 'VerifyHardwareAccelerated({{ feature }})', feature=feature): | 72 'VerifyHardwareAccelerated({{ feature }})', feature=feature): |
| 73 print 'Test failed. Printing page contents:' | 73 print 'Test failed. Printing page contents:' |
| 74 print tab.EvaluateJavaScript2('document.body.innerHTML') | 74 print tab.EvaluateJavaScript2('document.body.innerHTML') |
| 75 self.fail('%s not hardware accelerated' % feature) | 75 self.fail('%s not hardware accelerated' % feature) |
| 76 | 76 |
| 77 def load_tests(loader, tests, pattern): | 77 def load_tests(loader, tests, pattern): |
| 78 del loader, tests, pattern # Unused. | 78 del loader, tests, pattern # Unused. |
| 79 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) | 79 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) |
| OLD | NEW |