| 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 import collections | 4 import collections |
| 5 import json | 5 import json |
| 6 import os | 6 import os |
| 7 | 7 |
| 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 23 matching lines...) Expand all Loading... |
| 34 totals.append(total) | 34 totals.append(total) |
| 35 for key, values in r.iteritems(): | 35 for key, values in r.iteritems(): |
| 36 results.Add(key, 'ms', values, data_type='unimportant') | 36 results.Add(key, 'ms', values, data_type='unimportant') |
| 37 results.Add('Total', 'ms', totals) | 37 results.Add('Total', 'ms', totals) |
| 38 | 38 |
| 39 | 39 |
| 40 class Sunspider(test.Test): | 40 class Sunspider(test.Test): |
| 41 """Performance on Apple's SunSpider JavaScript benchmark""" | 41 """Performance on Apple's SunSpider JavaScript benchmark""" |
| 42 test = SunspiderMeasurement | 42 test = SunspiderMeasurement |
| 43 | 43 |
| 44 @staticmethod |
| 45 def CanRunOnBot(bot_properties): |
| 46 return bot_properties.master_name in ['default', 'chromium.perf'] |
| 47 |
| 44 def CreatePageSet(self, options): | 48 def CreatePageSet(self, options): |
| 45 sunspider_dir = os.path.join(util.GetChromiumSrcDir(), | 49 sunspider_dir = os.path.join(util.GetChromiumSrcDir(), |
| 46 'chrome', 'test', 'data', 'sunspider') | 50 'chrome', 'test', 'data', 'sunspider') |
| 47 return page_set.PageSet.FromDict( | 51 return page_set.PageSet.FromDict( |
| 48 { | 52 { |
| 49 'serving_dirs': [''], | 53 'serving_dirs': [''], |
| 50 'pages': [{ 'url': 'file:///sunspider-1.0/driver.html' }], | 54 'pages': [{ 'url': 'file:///sunspider-1.0/driver.html' }], |
| 51 }, | 55 }, |
| 52 sunspider_dir) | 56 sunspider_dir) |
| OLD | NEW |