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

Side by Side Diff: tools/perf/benchmarks/sunspider.py

Issue 562243004: Revert of Change PageTest.WillStartBrowser to depend on platform instead of browser object as it would not ha… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « tools/perf/benchmarks/robohornet_pro.py ('k') | tools/perf/measurements/image_decoding.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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 import collections 4 import collections
5 import json 5 import json
6 import os 6 import os
7 7
8 from metrics import power 8 from metrics import power
9 from telemetry import benchmark 9 from telemetry import benchmark
10 from telemetry.page import page_set 10 from telemetry.page import page_set
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 74
75 class _SunspiderMeasurement(page_test.PageTest): 75 class _SunspiderMeasurement(page_test.PageTest):
76 def __init__(self): 76 def __init__(self):
77 super(_SunspiderMeasurement, self).__init__() 77 super(_SunspiderMeasurement, self).__init__()
78 self._power_metric = None 78 self._power_metric = None
79 79
80 def CustomizeBrowserOptions(self, options): 80 def CustomizeBrowserOptions(self, options):
81 power.PowerMetric.CustomizeBrowserOptions(options) 81 power.PowerMetric.CustomizeBrowserOptions(options)
82 82
83 def WillStartBrowser(self, platform): 83 def WillStartBrowser(self, browser):
84 self._power_metric = power.PowerMetric(platform) 84 self._power_metric = power.PowerMetric(browser)
85 85
86 def DidNavigateToPage(self, page, tab): 86 def DidNavigateToPage(self, page, tab):
87 self._power_metric.Start(page, tab) 87 self._power_metric.Start(page, tab)
88 88
89 def ValidateAndMeasurePage(self, page, tab, results): 89 def ValidateAndMeasurePage(self, page, tab, results):
90 tab.WaitForJavaScriptExpression( 90 tab.WaitForJavaScriptExpression(
91 'window.location.pathname.indexOf("results.html") >= 0' 91 'window.location.pathname.indexOf("results.html") >= 0'
92 '&& typeof(output) != "undefined"', 300) 92 '&& typeof(output) != "undefined"', 300)
93 93
94 self._power_metric.Stop(page, tab) 94 self._power_metric.Stop(page, tab)
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 """Apple's SunSpider JavaScript benchmark.""" 127 """Apple's SunSpider JavaScript benchmark."""
128 test = _SunspiderMeasurement 128 test = _SunspiderMeasurement
129 129
130 def CreatePageSet(self, options): 130 def CreatePageSet(self, options):
131 ps = page_set.PageSet( 131 ps = page_set.PageSet(
132 archive_data_file='../page_sets/data/sunspider.json', 132 archive_data_file='../page_sets/data/sunspider.json',
133 make_javascript_deterministic=False, 133 make_javascript_deterministic=False,
134 file_path=os.path.abspath(__file__)) 134 file_path=os.path.abspath(__file__))
135 ps.AddPageWithDefaultRunNavigate(_URL) 135 ps.AddPageWithDefaultRunNavigate(_URL)
136 return ps 136 return ps
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/robohornet_pro.py ('k') | tools/perf/measurements/image_decoding.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698