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

Side by Side Diff: tools/perf/perf_tools/jsgamebench.py

Issue 15463003: [Telemetry] Utilize CreatePageSet for benchmarks with one page set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make file_path required Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/perf_tools/dom_perf.py ('k') | tools/perf/perf_tools/kraken.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Runs Facebook's JSGameBench benchmark."""
6
7 import os
8
5 from telemetry.core import util 9 from telemetry.core import util
6 from telemetry.page import page_measurement 10 from telemetry.page import page_measurement
11 from telemetry.page import page_set
7 12
8 class JsGameBench(page_measurement.PageMeasurement): 13 class JsGameBench(page_measurement.PageMeasurement):
14 def CreatePageSet(self, options):
15 return page_set.PageSet.FromDict({
16 'archive_data_file': '../data/jsgamebench.json',
17 'pages': [
18 { 'url': 'http://localhost/' }
19 ]
20 }, os.path.abspath(__file__))
21
9 def MeasurePage(self, _, tab, results): 22 def MeasurePage(self, _, tab, results):
10 tab.ExecuteJavaScript('UI.call({}, "perftest")') 23 tab.ExecuteJavaScript('UI.call({}, "perftest")')
11 24
12 js_is_done = 'document.getElementById("perfscore0") != null' 25 js_is_done = 'document.getElementById("perfscore0") != null'
13 def _IsDone(): 26 def _IsDone():
14 return bool(tab.EvaluateJavaScript(js_is_done)) 27 return bool(tab.EvaluateJavaScript(js_is_done))
15 util.WaitFor(_IsDone, 1200) 28 util.WaitFor(_IsDone, 1200)
16 29
17 js_get_results = 'document.getElementById("perfscore0").innerHTML' 30 js_get_results = 'document.getElementById("perfscore0").innerHTML'
18 result = int(tab.EvaluateJavaScript(js_get_results)) 31 result = int(tab.EvaluateJavaScript(js_get_results))
19 results.Add('Score', 'score (bigger is better)', result) 32 results.Add('Score', 'score (bigger is better)', result)
OLDNEW
« no previous file with comments | « tools/perf/perf_tools/dom_perf.py ('k') | tools/perf/perf_tools/kraken.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698