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 | 4 |
5 import math | 5 import math |
6 import os | 6 import os |
7 | 7 |
8 from core import perf_benchmark | 8 from core import perf_benchmark |
9 | 9 |
10 from telemetry import benchmark | 10 from telemetry import benchmark |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 AddResult(key, math.exp(value['sum'] / value['count'])) | 97 AddResult(key, math.exp(value['sum'] / value['count'])) |
98 | 98 |
99 class _DromaeoBenchmark(perf_benchmark.PerfBenchmark): | 99 class _DromaeoBenchmark(perf_benchmark.PerfBenchmark): |
100 """A base class for Dromaeo benchmarks.""" | 100 """A base class for Dromaeo benchmarks.""" |
101 test = _DromaeoMeasurement | 101 test = _DromaeoMeasurement |
102 | 102 |
103 @classmethod | 103 @classmethod |
104 def Name(cls): | 104 def Name(cls): |
105 return 'dromaeo' | 105 return 'dromaeo' |
106 | 106 |
107 def CreateStorySet(self, options): | 107 def CreatePageSet(self, options): |
108 """Makes a PageSet for Dromaeo benchmarks.""" | 108 """Makes a PageSet for Dromaeo benchmarks.""" |
109 # Subclasses are expected to define class members called query_param and | 109 # Subclasses are expected to define class members called query_param and |
110 # tag. | 110 # tag. |
111 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): | 111 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): |
112 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') | 112 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') |
113 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag | 113 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag |
114 ps = page_set.PageSet( | 114 ps = page_set.PageSet( |
115 archive_data_file=archive_data_file, | 115 archive_data_file=archive_data_file, |
116 base_dir=os.path.dirname(os.path.abspath(__file__)), | 116 base_dir=os.path.dirname(os.path.abspath(__file__)), |
117 bucket=page_set.PUBLIC_BUCKET) | 117 bucket=page_set.PUBLIC_BUCKET) |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 Tests traversing a DOM structure using the Prototype JavaScript Library. | 323 Tests traversing a DOM structure using the Prototype JavaScript Library. |
324 """ | 324 """ |
325 tag = 'cssqueryjquery' | 325 tag = 'cssqueryjquery' |
326 query_param = 'cssquery-jquery' | 326 query_param = 'cssquery-jquery' |
327 | 327 |
328 @classmethod | 328 @classmethod |
329 def Name(cls): | 329 def Name(cls): |
330 return 'dromaeo.cssqueryjquery' | 330 return 'dromaeo.cssqueryjquery' |
331 | 331 |
OLD | NEW |