| 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) | |
| 123 url = 'http://dromaeo.com?%s' % self.query_param | 122 url = 'http://dromaeo.com?%s' % self.query_param |
| 124 ps.AddStory(page_module.Page( | 123 ps.AddStory(page_module.Page( |
| 125 url, ps, ps.base_dir, make_javascript_deterministic=False, name=url)) | 124 url, ps, ps.base_dir, make_javascript_deterministic=False, name=url)) |
| 126 return ps | 125 return ps |
| 127 | 126 |
| 128 | 127 |
| 129 @benchmark.Owner(emails=['jbroman@chromium.org', | 128 @benchmark.Owner(emails=['jbroman@chromium.org', |
| 130 'yukishiino@chromium.org', | 129 'yukishiino@chromium.org', |
| 131 'haraken@chromium.org']) | 130 'haraken@chromium.org']) |
| 132 class DromaeoDomCoreAttr(_DromaeoBenchmark): | 131 class DromaeoDomCoreAttr(_DromaeoBenchmark): |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 203 |
| 205 @classmethod | 204 @classmethod |
| 206 def Name(cls): | 205 def Name(cls): |
| 207 return 'dromaeo.domcoretraverse' | 206 return 'dromaeo.domcoretraverse' |
| 208 | 207 |
| 209 def GetExpectations(self): | 208 def GetExpectations(self): |
| 210 class StoryExpectations(story.expectations.StoryExpectations): | 209 class StoryExpectations(story.expectations.StoryExpectations): |
| 211 def SetExpectations(self): | 210 def SetExpectations(self): |
| 212 pass # http://dromaeo.com?dom-traverse not disabled. | 211 pass # http://dromaeo.com?dom-traverse not disabled. |
| 213 return StoryExpectations() | 212 return StoryExpectations() |
| OLD | NEW |