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

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

Issue 12294002: Revert 182991 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 from telemetry.core import util 4
5 from telemetry.page import multi_page_benchmark 5 from telemetry import multi_page_benchmark
6 from telemetry import util
6 7
7 class Octane(multi_page_benchmark.MultiPageBenchmark): 8 class Octane(multi_page_benchmark.MultiPageBenchmark):
8 def MeasurePage(self, _, tab, results): 9 def MeasurePage(self, _, tab, results):
9 js_is_done = """ 10 js_is_done = """
10 completed && !document.getElementById("progress-bar-container")""" 11 completed && !document.getElementById("progress-bar-container")"""
11 def _IsDone(): 12 def _IsDone():
12 return bool(tab.EvaluateJavaScript(js_is_done)) 13 return bool(tab.EvaluateJavaScript(js_is_done))
13 util.WaitFor(_IsDone, 300, poll_interval=5) 14 util.WaitFor(_IsDone, 300, poll_interval=5)
14 15
15 js_get_results = """ 16 js_get_results = """
(...skipping 10 matching lines...) Expand all
26 JSON.stringify(results); 27 JSON.stringify(results);
27 """ 28 """
28 result_dict = eval(tab.EvaluateJavaScript(js_get_results)) 29 result_dict = eval(tab.EvaluateJavaScript(js_get_results))
29 for key, value in result_dict.iteritems(): 30 for key, value in result_dict.iteritems():
30 if value == '...': 31 if value == '...':
31 continue 32 continue
32 data_type = 'unimportant' 33 data_type = 'unimportant'
33 if key == 'score': 34 if key == 'score':
34 data_type = 'default' 35 data_type = 'default'
35 results.Add(key, 'score (bigger is better)', value, data_type=data_type) 36 results.Add(key, 'score (bigger is better)', value, data_type=data_type)
OLDNEW
« no previous file with comments | « tools/perf/perf_tools/memory_benchmark_unittest.py ('k') | tools/perf/perf_tools/page_cycler.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698