| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 def CreatePageSet(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 file_path=os.path.abspath(__file__), bucket=page_set.PUBLIC_BUCKET) | 116 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 117 bucket=page_set.PUBLIC_BUCKET) |
| 117 url = 'http://dromaeo.com?%s' % self.query_param | 118 url = 'http://dromaeo.com?%s' % self.query_param |
| 118 ps.AddUserStory(page_module.Page( | 119 ps.AddUserStory(page_module.Page( |
| 119 url, ps, ps.base_dir, make_javascript_deterministic=False)) | 120 url, ps, ps.base_dir, make_javascript_deterministic=False)) |
| 120 return ps | 121 return ps |
| 121 | 122 |
| 122 | 123 |
| 123 class DromaeoDomCoreAttr(_DromaeoBenchmark): | 124 class DromaeoDomCoreAttr(_DromaeoBenchmark): |
| 124 """Dromaeo DOMCore attr JavaScript benchmark. | 125 """Dromaeo DOMCore attr JavaScript benchmark. |
| 125 | 126 |
| 126 Tests setting and getting DOM node attributes. | 127 Tests setting and getting DOM node attributes. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 321 |
| 321 Tests traversing a DOM structure using the Prototype JavaScript Library. | 322 Tests traversing a DOM structure using the Prototype JavaScript Library. |
| 322 """ | 323 """ |
| 323 tag = 'cssqueryjquery' | 324 tag = 'cssqueryjquery' |
| 324 query_param = 'cssquery-jquery' | 325 query_param = 'cssquery-jquery' |
| 325 | 326 |
| 326 @classmethod | 327 @classmethod |
| 327 def Name(cls): | 328 def Name(cls): |
| 328 return 'dromaeo.cssqueryjquery' | 329 return 'dromaeo.cssqueryjquery' |
| 329 | 330 |
| OLD | NEW |