| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 os | 5 import os |
| 6 | 6 |
| 7 from metrics import power | 7 from metrics import power |
| 8 from telemetry import test | 8 from telemetry import test |
| 9 from telemetry.core import util | 9 from telemetry.core import util |
| 10 from telemetry.page import page_measurement | 10 from telemetry.page import page_measurement |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 def CreatePageSet(self, options): | 54 def CreatePageSet(self, options): |
| 55 """Makes a PageSet for Dromaeo benchmarks.""" | 55 """Makes a PageSet for Dromaeo benchmarks.""" |
| 56 # Subclasses are expected to define a class member called query_param. | 56 # Subclasses are expected to define a class member called query_param. |
| 57 if not hasattr(self, 'query_param'): | 57 if not hasattr(self, 'query_param'): |
| 58 raise NotImplementedError('query_param not in Dromaeo benchmark.') | 58 raise NotImplementedError('query_param not in Dromaeo benchmark.') |
| 59 url = 'file://index.html?%s&automated' % self.query_param | 59 url = 'file://index.html?%s&automated' % self.query_param |
| 60 # The docstring of benchmark classes may also be used as a description | 60 # The docstring of benchmark classes may also be used as a description |
| 61 # when 'run_benchmarks list' is run. | 61 # when 'run_benchmarks list' is run. |
| 62 description = self.__doc__ or 'Dromaeo JavaScript Benchmark' | 62 description = self.__doc__ or 'Dromaeo JavaScript Benchmark' |
| 63 page_set_dict = { | |
| 64 'description': description, | |
| 65 'pages': [{'url': url}], | |
| 66 } | |
| 67 dromaeo_dir = os.path.join(util.GetChromiumSrcDir(), | 63 dromaeo_dir = os.path.join(util.GetChromiumSrcDir(), |
| 68 'chrome', 'test', 'data', 'dromaeo') | 64 'chrome', 'test', 'data', 'dromaeo') |
| 69 return page_set.PageSet.FromDict(page_set_dict, dromaeo_dir) | 65 ps = page_set.PageSet(description=description, |
| 66 file_path=dromaeo_dir) |
| 67 ps.AddPageWithDefaultRunNavigate(url) |
| 68 return ps |
| 70 | 69 |
| 71 | 70 |
| 72 class DromaeoDomCoreAttr(_DromaeoBenchmark): | 71 class DromaeoDomCoreAttr(_DromaeoBenchmark): |
| 73 """Dromaeo DOMCore attr JavaScript benchmark.""" | 72 """Dromaeo DOMCore attr JavaScript benchmark.""" |
| 74 tag = 'domcoreattr' | 73 tag = 'domcoreattr' |
| 75 query_param = 'dom-attr' | 74 query_param = 'dom-attr' |
| 76 | 75 |
| 77 | 76 |
| 78 class DromaeoDomCoreModify(_DromaeoBenchmark): | 77 class DromaeoDomCoreModify(_DromaeoBenchmark): |
| 79 """Dromaeo DOMCore modify JavaScript benchmark.""" | 78 """Dromaeo DOMCore modify JavaScript benchmark.""" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 """Dromaeo JSLib traverse jquery JavaScript benchmark""" | 144 """Dromaeo JSLib traverse jquery JavaScript benchmark""" |
| 146 tag = 'jslibtraversejquery' | 145 tag = 'jslibtraversejquery' |
| 147 query_param = 'jslib-traverse-jquery' | 146 query_param = 'jslib-traverse-jquery' |
| 148 | 147 |
| 149 | 148 |
| 150 class DromaeoJslibTraversePrototype(_DromaeoBenchmark): | 149 class DromaeoJslibTraversePrototype(_DromaeoBenchmark): |
| 151 """Dromaeo JSLib traverse prototype JavaScript benchmark""" | 150 """Dromaeo JSLib traverse prototype JavaScript benchmark""" |
| 152 tag = 'jslibtraverseprototype' | 151 tag = 'jslibtraverseprototype' |
| 153 query_param = 'jslib-traverse-prototype' | 152 query_param = 'jslib-traverse-prototype' |
| 154 | 153 |
| OLD | NEW |