Chromium Code Reviews| Index: tools/perf/benchmarks/sunspider.py |
| diff --git a/tools/perf/perf_tools/sunspider.py b/tools/perf/benchmarks/sunspider.py |
| similarity index 56% |
| rename from tools/perf/perf_tools/sunspider.py |
| rename to tools/perf/benchmarks/sunspider.py |
| index d9858373e6bd16d982fac66569c3ab0fec341777..8317f8c6eb42cddbebb3ae1b7da01e733c9d101e 100644 |
| --- a/tools/perf/perf_tools/sunspider.py |
| +++ b/tools/perf/benchmarks/sunspider.py |
| @@ -1,33 +1,22 @@ |
| -# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| - |
| -"""Runs Apple's SunSpider JavaScript benchmark.""" |
| - |
| import collections |
| import json |
| import os |
| +from telemetry import test |
| from telemetry.core import util |
| from telemetry.page import page_measurement |
| from telemetry.page import page_set |
| -class SunSpiderMeasurement(page_measurement.PageMeasurement): |
| - def CreatePageSet(self, _, options): |
| - return page_set.PageSet.FromDict({ |
| - 'serving_dirs': ['../../../chrome/test/data/sunspider/'], |
| - 'pages': [ |
| - { 'url': 'file:///../../../chrome/test/data/sunspider/' |
| - 'sunspider-1.0/driver.html' } |
| - ] |
| - }, os.path.abspath(__file__)) |
| +class SunspiderMeasurement(page_measurement.PageMeasurement): |
|
tonyg
2013/06/19 16:40:15
Does run_measurement sunspider still work (at leas
dtu
2013/06/19 21:22:58
Done. I re-added the existing measurements to perf
|
| def MeasurePage(self, _, tab, results): |
| - js_is_done = """ |
| -window.location.pathname.indexOf('results.html') >= 0""" |
| + js_is_done = 'window.location.pathname.indexOf("results.html") >= 0' |
| def _IsDone(): |
| return tab.EvaluateJavaScript(js_is_done) |
| - util.WaitFor(_IsDone, 300, poll_interval=5) |
| + util.WaitFor(_IsDone, 300, poll_interval=1) |
| js_get_results = 'JSON.stringify(output);' |
| js_results = json.loads(tab.EvaluateJavaScript(js_get_results)) |
| @@ -45,3 +34,18 @@ window.location.pathname.indexOf('results.html') >= 0""" |
| for key, values in r.iteritems(): |
| results.Add(key, 'ms', values, data_type='unimportant') |
| results.Add('Total', 'ms', totals) |
| + |
| + |
| +class Sunspider(test.TelemetryTest): |
| + """Performance on Apple's SunSpider JavaScript benchmark""" |
| + test = SunspiderMeasurement |
| + |
| + def CreatePageSet(self, options): |
| + sunspider_dir = os.path.join(util.GetChromiumSrcDir(), |
| + 'chrome', 'test', 'data', 'sunspider') |
| + return page_set.PageSet.FromDict( |
| + { |
| + 'serving_dirs': [''], |
|
tonyg
2013/06/19 16:40:15
Can serving_dirs be omitted?
dtu
2013/06/19 21:22:58
No, otherwise it will only serve data/sunspider/su
|
| + 'pages': [{ 'url': 'file:///sunspider-1.0/driver.html' }], |
| + }, |
| + sunspider_dir) |