| 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 json | 5 import json |
| 6 import math | 6 import math |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 from core import perf_benchmark | 9 from core import perf_benchmark |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 def CreateStorySet(self, options): | 111 def CreateStorySet(self, options): |
| 112 """Makes a PageSet for Dromaeo benchmarks.""" | 112 """Makes a PageSet for Dromaeo benchmarks.""" |
| 113 # Subclasses are expected to define class members called query_param and | 113 # Subclasses are expected to define class members called query_param and |
| 114 # tag. | 114 # tag. |
| 115 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): | 115 if not hasattr(self, 'query_param') or not hasattr(self, 'tag'): |
| 116 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') | 116 raise NotImplementedError('query_param or tag not in Dromaeo benchmark.') |
| 117 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag | 117 archive_data_file = '../page_sets/data/dromaeo.%s.json' % self.tag |
| 118 ps = story.StorySet( | 118 ps = story.StorySet( |
| 119 archive_data_file=archive_data_file, | 119 archive_data_file=archive_data_file, |
| 120 base_dir=os.path.dirname(os.path.abspath(__file__)), | 120 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 121 cloud_storage_bucket=story.PUBLIC_BUCKET) | 121 cloud_storage_bucket=story.PUBLIC_BUCKET, |
| 122 verify_names=True) |
| 122 url = 'http://dromaeo.com?%s' % self.query_param | 123 url = 'http://dromaeo.com?%s' % self.query_param |
| 123 ps.AddStory(page_module.Page( | 124 ps.AddStory(page_module.Page( |
| 124 url, ps, ps.base_dir, make_javascript_deterministic=False)) | 125 url, ps, ps.base_dir, make_javascript_deterministic=False, name=url)) |
| 125 return ps | 126 return ps |
| 126 | 127 |
| 127 | 128 |
| 128 @benchmark.Owner(emails=['yukishiino@chromium.org', | 129 @benchmark.Owner(emails=['yukishiino@chromium.org', |
| 129 'bashi@chromium.org', | 130 'bashi@chromium.org', |
| 130 'haraken@chromium.org']) | 131 'haraken@chromium.org']) |
| 131 class DromaeoDomCoreAttr(_DromaeoBenchmark): | 132 class DromaeoDomCoreAttr(_DromaeoBenchmark): |
| 132 """Dromaeo DOMCore attr JavaScript benchmark. | 133 """Dromaeo DOMCore attr JavaScript benchmark. |
| 133 | 134 |
| 134 Tests setting and getting DOM node attributes. | 135 Tests setting and getting DOM node attributes. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 """Dromaeo DOMCore traverse JavaScript benchmark. | 181 """Dromaeo DOMCore traverse JavaScript benchmark. |
| 181 | 182 |
| 182 Tests traversing a DOM structure. | 183 Tests traversing a DOM structure. |
| 183 """ | 184 """ |
| 184 tag = 'domcoretraverse' | 185 tag = 'domcoretraverse' |
| 185 query_param = 'dom-traverse' | 186 query_param = 'dom-traverse' |
| 186 | 187 |
| 187 @classmethod | 188 @classmethod |
| 188 def Name(cls): | 189 def Name(cls): |
| 189 return 'dromaeo.domcoretraverse' | 190 return 'dromaeo.domcoretraverse' |
| OLD | NEW |