| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 hardware_accelerated_feature_expectations as expectations | 4 import hardware_accelerated_feature_expectations as expectations |
| 5 | 5 |
| 6 from telemetry import test | 6 from telemetry import test |
| 7 from telemetry.page import page_set | 7 from telemetry.page import page_set |
| 8 from telemetry.page import page_test | 8 from telemetry.page import page_test |
| 9 | 9 |
| 10 test_harness_script = r""" | 10 test_harness_script = r""" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 return feature.lower().replace(' ', '_') | 37 return feature.lower().replace(' ', '_') |
| 38 | 38 |
| 39 class HardwareAcceleratedFeature(test.Test): | 39 class HardwareAcceleratedFeature(test.Test): |
| 40 """Tests GPU acceleration is reported as active for various features""" | 40 """Tests GPU acceleration is reported as active for various features""" |
| 41 test = _HardwareAcceleratedFeatureValidator | 41 test = _HardwareAcceleratedFeatureValidator |
| 42 | 42 |
| 43 def CreateExpectations(self, page_set): | 43 def CreateExpectations(self, page_set): |
| 44 return expectations.HardwareAcceleratedFeatureExpectations() | 44 return expectations.HardwareAcceleratedFeatureExpectations() |
| 45 | 45 |
| 46 def CreatePageSet(self, options): | 46 def CreatePageSet(self, options): |
| 47 features = ['WebGL', 'Canvas', '3D CSS'] | 47 features = ['WebGL', 'Canvas'] |
| 48 | 48 |
| 49 page_set_dict = { | 49 page_set_dict = { |
| 50 'description': 'Tests GPU acceleration is reported as active', | 50 'description': 'Tests GPU acceleration is reported as active', |
| 51 'user_agent_type': 'desktop', | 51 'user_agent_type': 'desktop', |
| 52 'pages': [] | 52 'pages': [] |
| 53 } | 53 } |
| 54 | 54 |
| 55 pages = page_set_dict['pages'] | 55 pages = page_set_dict['pages'] |
| 56 | 56 |
| 57 for feature in features: | 57 for feature in features: |
| 58 pages.append({ | 58 pages.append({ |
| 59 'name': 'HardwareAcceleratedFeature.%s_accelerated' % | 59 'name': 'HardwareAcceleratedFeature.%s_accelerated' % |
| 60 safe_feature_name(feature), | 60 safe_feature_name(feature), |
| 61 'url': 'chrome://gpu', | 61 'url': 'chrome://gpu', |
| 62 'navigate_steps': [ | 62 'navigate_steps': [ |
| 63 { "action": 'navigate' } | 63 { "action": 'navigate' } |
| 64 ], | 64 ], |
| 65 'script_to_evaluate_on_commit': test_harness_script, | 65 'script_to_evaluate_on_commit': test_harness_script, |
| 66 'feature': feature | 66 'feature': feature |
| 67 }) | 67 }) |
| 68 | 68 |
| 69 return page_set.PageSet.FromDict(page_set_dict, '') | 69 return page_set.PageSet.FromDict(page_set_dict, '') |
| OLD | NEW |