Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: tools/perf/benchmarks/sunspider.py

Issue 17438002: [telemetry] test_runner and run_benchmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update docs? Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/benchmarks/smoothness.py ('k') | tools/perf/measurements/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c588d6b1d66fff4c00f3aaa92f27dffcda224364 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):
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.Test):
+ """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': [''],
+ 'pages': [{ 'url': 'file:///sunspider-1.0/driver.html' }],
+ },
+ sunspider_dir)
« no previous file with comments | « tools/perf/benchmarks/smoothness.py ('k') | tools/perf/measurements/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698