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

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

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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
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 from telemetry import multi_page_benchmark 5 from telemetry.core import util
6 from telemetry import util 6 from telemetry.page import multi_page_benchmark
7 7
8 class JsGameBench(multi_page_benchmark.MultiPageBenchmark): 8 class JsGameBench(multi_page_benchmark.MultiPageBenchmark):
9 def MeasurePage(self, _, tab, results): 9 def MeasurePage(self, _, tab, results):
10 tab.ExecuteJavaScript('UI.call({}, "perftest")') 10 tab.ExecuteJavaScript('UI.call({}, "perftest")')
11 11
12 js_is_done = 'document.getElementById("perfscore0") != null' 12 js_is_done = 'document.getElementById("perfscore0") != null'
13 def _IsDone(): 13 def _IsDone():
14 return bool(tab.EvaluateJavaScript(js_is_done)) 14 return bool(tab.EvaluateJavaScript(js_is_done))
15 util.WaitFor(_IsDone, 1200) 15 util.WaitFor(_IsDone, 1200)
16 16
17 js_get_results = 'document.getElementById("perfscore0").innerHTML' 17 js_get_results = 'document.getElementById("perfscore0").innerHTML'
18 result = int(tab.EvaluateJavaScript(js_get_results)) 18 result = int(tab.EvaluateJavaScript(js_get_results))
19 results.Add('Score', 'score (bigger is better)', result) 19 results.Add('Score', 'score (bigger is better)', result)
OLDNEW
« no previous file with comments | « tools/perf/perf_tools/image_decoding_benchmark_unittest.py ('k') | tools/perf/perf_tools/kraken.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698