| 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 metrics import power | 8 from metrics import power |
| 9 from telemetry import benchmark | 9 from telemetry import benchmark |
| 10 from telemetry import page as page_module |
| 10 from telemetry.page import page_set | 11 from telemetry.page import page_set |
| 11 from telemetry.page import page_test | 12 from telemetry.page import page_test |
| 12 from telemetry.value import scalar | 13 from telemetry.value import scalar |
| 13 | 14 |
| 14 | 15 |
| 15 class _DromaeoMeasurement(page_test.PageTest): | 16 class _DromaeoMeasurement(page_test.PageTest): |
| 16 def __init__(self): | 17 def __init__(self): |
| 17 super(_DromaeoMeasurement, self).__init__() | 18 super(_DromaeoMeasurement, self).__init__() |
| 18 self._power_metric = None | 19 self._power_metric = None |
| 19 | 20 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 # Subclasses are expected to define class members called query_param and | 102 # Subclasses are expected to define class members called query_param and |
| 102 # tag. | 103 # tag. |
| 103 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): | 104 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): |
| 104 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') | 105 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') |
| 105 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag | 106 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag |
| 106 ps = page_set.PageSet( | 107 ps = page_set.PageSet( |
| 107 make_javascript_deterministic=False, | 108 make_javascript_deterministic=False, |
| 108 archive_data_file=archive_data_file, | 109 archive_data_file=archive_data_file, |
| 109 file_path=os.path.abspath(__file__), bucket=page_set.PUBLIC_BUCKET) | 110 file_path=os.path.abspath(__file__), bucket=page_set.PUBLIC_BUCKET) |
| 110 url = 'http://dromaeo.com?%s' % self.query_param | 111 url = 'http://dromaeo.com?%s' % self.query_param |
| 111 ps.AddPageWithDefaultRunNavigate(url) | 112 ps.AddUserStory(page_module.Page(url, ps, ps.base_dir)) |
| 112 return ps | 113 return ps |
| 113 | 114 |
| 114 | 115 |
| 115 class DromaeoDomCoreAttr(_DromaeoBenchmark): | 116 class DromaeoDomCoreAttr(_DromaeoBenchmark): |
| 116 """Dromaeo DOMCore attr JavaScript benchmark.""" | 117 """Dromaeo DOMCore attr JavaScript benchmark.""" |
| 117 tag = 'domcoreattr' | 118 tag = 'domcoreattr' |
| 118 query_param = 'dom-attr' | 119 query_param = 'dom-attr' |
| 119 | 120 |
| 120 | 121 |
| 121 class DromaeoDomCoreModify(_DromaeoBenchmark): | 122 class DromaeoDomCoreModify(_DromaeoBenchmark): |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 """Dromaeo JSLib traverse prototype JavaScript benchmark""" | 196 """Dromaeo JSLib traverse prototype JavaScript benchmark""" |
| 196 tag = 'jslibtraverseprototype' | 197 tag = 'jslibtraverseprototype' |
| 197 query_param = 'jslib-traverse-prototype' | 198 query_param = 'jslib-traverse-prototype' |
| 198 | 199 |
| 199 | 200 |
| 200 class DromaeoCSSQueryJquery(_DromaeoBenchmark): | 201 class DromaeoCSSQueryJquery(_DromaeoBenchmark): |
| 201 """Dromaeo CSS Query jquery JavaScript benchmark""" | 202 """Dromaeo CSS Query jquery JavaScript benchmark""" |
| 202 tag = 'cssqueryjquery' | 203 tag = 'cssqueryjquery' |
| 203 query_param = 'cssquery-jquery' | 204 query_param = 'cssquery-jquery' |
| 204 | 205 |
| OLD | NEW |