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

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

Issue 736653002: [Pywebsocket PerformanceTests 2/2] Add blink_perf.pywebsocket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary variables Created 5 years, 11 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 | « no previous file | tools/perf/benchmarks/pywebsocket_server.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 4
5 import os 5 import os
6 6
7 from benchmarks import pywebsocket_server
7 from telemetry import benchmark 8 from telemetry import benchmark
8 from telemetry import page as page_module 9 from telemetry import page as page_module
9 from telemetry.core import util 10 from telemetry.core import util
10 from telemetry.page import page_set 11 from telemetry.page import page_set
11 from telemetry.page import page_test 12 from telemetry.page import page_test
12 from telemetry.value import list_of_scalar_values 13 from telemetry.value import list_of_scalar_values
13 14
14 15
15 BLINK_PERF_BASE_DIR = os.path.join(util.GetChromiumSrcDir(), 16 BLINK_PERF_BASE_DIR = os.path.join(util.GetChromiumSrcDir(),
16 'third_party', 'WebKit', 'PerformanceTests') 17 'third_party', 'WebKit', 'PerformanceTests')
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 units = parts[-1] 95 units = parts[-1]
95 metric = page.display_name.split('.')[0].replace('/', '_') 96 metric = page.display_name.split('.')[0].replace('/', '_')
96 results.AddValue(list_of_scalar_values.ListOfScalarValues( 97 results.AddValue(list_of_scalar_values.ListOfScalarValues(
97 results.current_page, metric, units, values)) 98 results.current_page, metric, units, values))
98 99
99 break 100 break
100 101
101 print log 102 print log
102 103
103 104
105 class _BlinkPerfWithPywebsocketMeasurement(_BlinkPerfMeasurement):
106 """Runs a Blink performance test with pywebsocket server."""
107
108 def __init__(self):
109 super(_BlinkPerfWithPywebsocketMeasurement, self).__init__()
110
111 def CustomizeBrowserOptions(self, options):
112 super(_BlinkPerfWithPywebsocketMeasurement, self).CustomizeBrowserOptions(
113 options)
114 # Cross-origin accesses are needed to run benchmarks spanning two servers,
115 # the Telemetry's HTTP server and the pywebsocket server.
116 options.AppendExtraBrowserArgs([
117 '--disable-web-security'
118 ])
119
120 def DidStartBrowser(self, browser):
nednguyen 2015/01/21 16:45:48 Don't rely on the DidStartBrowser hook, you will w
hiroshige 2015/04/03 11:11:41 Done.
121 if browser.GetRunningLocalServer(
122 pywebsocket_server.PywebsocketServer, None):
123 return
124
125 server = pywebsocket_server.PywebsocketServer()
126 browser.StartLocalServer(server)
127 return
128
129
104 class _BlinkPerfFullFrameMeasurement(_BlinkPerfMeasurement): 130 class _BlinkPerfFullFrameMeasurement(_BlinkPerfMeasurement):
105 def __init__(self): 131 def __init__(self):
106 super(_BlinkPerfFullFrameMeasurement, self).__init__() 132 super(_BlinkPerfFullFrameMeasurement, self).__init__()
107 self._blink_perf_js += '\nwindow.fullFrameMeasurement = true;' 133 self._blink_perf_js += '\nwindow.fullFrameMeasurement = true;'
108 134
109 def CustomizeBrowserOptions(self, options): 135 def CustomizeBrowserOptions(self, options):
110 super(_BlinkPerfFullFrameMeasurement, self).CustomizeBrowserOptions( 136 super(_BlinkPerfFullFrameMeasurement, self).CustomizeBrowserOptions(
111 options) 137 options)
112 # Full layout measurement needs content_shell with internals testing API. 138 # Full layout measurement needs content_shell with internals testing API.
113 assert 'content-shell' in options.browser_type 139 assert 'content-shell' in options.browser_type
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 263
238 # This benchmark is for local testing, doesn't need to run on bots. 264 # This benchmark is for local testing, doesn't need to run on bots.
239 @benchmark.Disabled() 265 @benchmark.Disabled()
240 class BlinkPerfXMLHttpRequest(benchmark.Benchmark): 266 class BlinkPerfXMLHttpRequest(benchmark.Benchmark):
241 tag = 'xml_http_request' 267 tag = 'xml_http_request'
242 test = _BlinkPerfMeasurement 268 test = _BlinkPerfMeasurement
243 269
244 def CreatePageSet(self, options): 270 def CreatePageSet(self, options):
245 path = os.path.join(BLINK_PERF_BASE_DIR, 'XMLHttpRequest') 271 path = os.path.join(BLINK_PERF_BASE_DIR, 'XMLHttpRequest')
246 return CreatePageSetFromPath(path, SKIPPED_FILE) 272 return CreatePageSetFromPath(path, SKIPPED_FILE)
273
274
275 class BlinkPerfPywebsocket(benchmark.Benchmark):
276 tag = 'pywebsocket'
277 test = _BlinkPerfWithPywebsocketMeasurement
278
279 def CreatePageSet(self, options):
280 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket')
281 return CreatePageSetFromPath(path, SKIPPED_FILE)
OLDNEW
« no previous file with comments | « no previous file | tools/perf/benchmarks/pywebsocket_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698