Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/test/gpu/gpu_tests/hardware_accelerated_feature.py

Issue 2539973004: Update reference to page_test module to use legacy_page_test module (Closed)
Patch Set: update Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_test_base.py ('k') | content/test/gpu/gpu_tests/maps.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 from gpu_tests import gpu_test_base 4 from gpu_tests import gpu_test_base
5 import gpu_tests.hardware_accelerated_feature_expectations as hw_expectations 5 import gpu_tests.hardware_accelerated_feature_expectations as hw_expectations
6 6
7 from telemetry.page import page_test 7 from telemetry.page import legacy_page_test
8 from telemetry.story import story_set as story_set_module 8 from telemetry.story import story_set as story_set_module
9 9
10 test_harness_script = r""" 10 test_harness_script = r"""
11 function VerifyHardwareAccelerated(feature) { 11 function VerifyHardwareAccelerated(feature) {
12 feature += ': ' 12 feature += ': '
13 var list = document.querySelector('.feature-status-list'); 13 var list = document.querySelector('.feature-status-list');
14 for (var i=0; i < list.childElementCount; i++) { 14 for (var i=0; i < list.childElementCount; i++) {
15 var span_list = list.children[i].getElementsByTagName('span'); 15 var span_list = list.children[i].getElementsByTagName('span');
16 var feature_str = span_list[0].textContent; 16 var feature_str = span_list[0].textContent;
17 var value_str = span_list[1].textContent; 17 var value_str = span_list[1].textContent;
18 if ((feature_str == feature) && 18 if ((feature_str == feature) &&
19 (value_str == 'Hardware accelerated')) { 19 (value_str == 'Hardware accelerated')) {
20 return true; 20 return true;
21 } 21 }
22 } 22 }
23 return false; 23 return false;
24 }; 24 };
25 """ 25 """
26 26
27 class HardwareAcceleratedFeatureValidator(gpu_test_base.ValidatorBase): 27 class HardwareAcceleratedFeatureValidator(gpu_test_base.ValidatorBase):
28 def ValidateAndMeasurePage(self, page, tab, results): 28 def ValidateAndMeasurePage(self, page, tab, results):
29 feature = page.feature 29 feature = page.feature
30 if not tab.EvaluateJavaScript('VerifyHardwareAccelerated("%s")' % feature): 30 if not tab.EvaluateJavaScript('VerifyHardwareAccelerated("%s")' % feature):
31 print 'Test failed. Printing page contents:' 31 print 'Test failed. Printing page contents:'
32 print tab.EvaluateJavaScript('document.body.innerHTML') 32 print tab.EvaluateJavaScript('document.body.innerHTML')
33 raise page_test.Failure('%s not hardware accelerated' % feature) 33 raise legacy_page_test.Failure('%s not hardware accelerated' % feature)
34 34
35 def safe_feature_name(feature): 35 def safe_feature_name(feature):
36 return feature.lower().replace(' ', '_') 36 return feature.lower().replace(' ', '_')
37 37
38 class ChromeGpuPage(gpu_test_base.PageBase): 38 class ChromeGpuPage(gpu_test_base.PageBase):
39 def __init__(self, story_set, feature, expectations): 39 def __init__(self, story_set, feature, expectations):
40 super(ChromeGpuPage, self).__init__( 40 super(ChromeGpuPage, self).__init__(
41 url='chrome://gpu', page_set=story_set, base_dir=story_set.base_dir, 41 url='chrome://gpu', page_set=story_set, base_dir=story_set.base_dir,
42 name=('HardwareAcceleratedFeature.%s_accelerated' % 42 name=('HardwareAcceleratedFeature.%s_accelerated' %
43 safe_feature_name(feature)), 43 safe_feature_name(feature)),
(...skipping 14 matching lines...) Expand all
58 58
59 def CreateStorySet(self, options): 59 def CreateStorySet(self, options):
60 features = ['WebGL', 'Canvas'] 60 features = ['WebGL', 'Canvas']
61 61
62 ps = story_set_module.StorySet() 62 ps = story_set_module.StorySet()
63 63
64 for feature in features: 64 for feature in features:
65 ps.AddStory(ChromeGpuPage(story_set=ps, feature=feature, 65 ps.AddStory(ChromeGpuPage(story_set=ps, feature=feature,
66 expectations=self.GetExpectations())) 66 expectations=self.GetExpectations()))
67 return ps 67 return ps
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/gpu_test_base.py ('k') | content/test/gpu/gpu_tests/maps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698