OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 """Runs spaceport.io's PerfMarks benchmark.""" | 5 """Runs spaceport.io's PerfMarks benchmark.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 | 9 |
10 from telemetry import benchmark | 10 from telemetry import benchmark |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 logging.info('Completed test %d of %d' % | 79 logging.info('Completed test %d of %d' % |
80 (num_results, num_tests_in_spaceport)) | 80 (num_results, num_tests_in_spaceport)) |
81 | 81 |
82 result_dict = eval(tab.EvaluateJavaScript( | 82 result_dict = eval(tab.EvaluateJavaScript( |
83 'JSON.stringify(window.__results)')) | 83 'JSON.stringify(window.__results)')) |
84 for key in result_dict: | 84 for key in result_dict: |
85 chart, trace = key.split('.', 1) | 85 chart, trace = key.split('.', 1) |
86 results.AddValue(scalar.ScalarValue( | 86 results.AddValue(scalar.ScalarValue( |
87 results.current_page, '%s.%s'% (chart, trace), | 87 results.current_page, '%s.%s'% (chart, trace), |
88 'objects (bigger is better)', float(result_dict[key]), | 88 'objects (bigger is better)', float(result_dict[key]), |
89 important=False, description=DESCRIPTIONS.get(chart))) | 89 important=False, description=DESCRIPTIONS.get(chart), |
| 90 higher_is_better=True)) |
90 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 91 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
91 results.current_page, 'Score', 'objects (bigger is better)', | 92 results.current_page, 'Score', 'objects (bigger is better)', |
92 [float(x) for x in result_dict.values()], | 93 [float(x) for x in result_dict.values()], |
93 description='Combined score for all parts of the spaceport benchmark.')) | 94 description='Combined score for all parts of the spaceport benchmark.', |
| 95 higher_is_better=True)) |
94 | 96 |
95 | 97 |
96 # crbug.com/166703: This test frequently times out on Windows. | 98 # crbug.com/166703: This test frequently times out on Windows. |
97 @benchmark.Disabled('mac', 'win') | 99 @benchmark.Disabled('mac', 'win') |
98 class Spaceport(benchmark.Benchmark): | 100 class Spaceport(benchmark.Benchmark): |
99 """spaceport.io's PerfMarks benchmark.""" | 101 """spaceport.io's PerfMarks benchmark.""" |
100 test = _SpaceportMeasurement | 102 test = _SpaceportMeasurement |
101 | 103 |
102 def CreatePageSet(self, options): | 104 def CreatePageSet(self, options): |
103 spaceport_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', | 105 spaceport_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', |
104 'data', 'third_party', 'spaceport') | 106 'data', 'third_party', 'spaceport') |
105 ps = page_set.PageSet(file_path=spaceport_dir) | 107 ps = page_set.PageSet(file_path=spaceport_dir) |
106 ps.AddUserStory(page_module.Page('file://index.html', ps, ps.base_dir)) | 108 ps.AddUserStory(page_module.Page('file://index.html', ps, ps.base_dir)) |
107 return ps | 109 return ps |
OLD | NEW |