| OLD | NEW |
| 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 core import path_util | 7 from core import path_util |
| 8 from core import perf_benchmark | 8 from core import perf_benchmark |
| 9 | 9 |
| 10 from telemetry import benchmark | 10 from telemetry import benchmark |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 units = parts[-1] | 105 units = parts[-1] |
| 106 metric = page.display_name.split('.')[0].replace('/', '_') | 106 metric = page.display_name.split('.')[0].replace('/', '_') |
| 107 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 107 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
| 108 results.current_page, metric, units, values)) | 108 results.current_page, metric, units, values)) |
| 109 | 109 |
| 110 break | 110 break |
| 111 | 111 |
| 112 print log | 112 print log |
| 113 | 113 |
| 114 | 114 |
| 115 class _BlinkPerfFullFrameMeasurement(_BlinkPerfMeasurement): | |
| 116 def __init__(self): | |
| 117 super(_BlinkPerfFullFrameMeasurement, self).__init__() | |
| 118 self._blink_perf_js += '\nwindow.fullFrameMeasurement = true;' | |
| 119 | |
| 120 def CustomizeBrowserOptions(self, options): | |
| 121 super(_BlinkPerfFullFrameMeasurement, self).CustomizeBrowserOptions( | |
| 122 options) | |
| 123 # Full layout measurement needs content_shell with internals testing API. | |
| 124 assert 'content-shell' in options.browser_type | |
| 125 options.AppendExtraBrowserArgs(['--expose-internals-for-testing']) | |
| 126 | |
| 127 | |
| 128 class _SharedPywebsocketPageState(shared_page_state.SharedPageState): | 115 class _SharedPywebsocketPageState(shared_page_state.SharedPageState): |
| 129 """Runs a pywebsocket server.""" | 116 """Runs a pywebsocket server.""" |
| 130 def __init__(self, test, finder_options, user_story_set): | 117 def __init__(self, test, finder_options, user_story_set): |
| 131 super(_SharedPywebsocketPageState, self).__init__( | 118 super(_SharedPywebsocketPageState, self).__init__( |
| 132 test, finder_options, user_story_set) | 119 test, finder_options, user_story_set) |
| 133 self.platform.StartLocalServer(pywebsocket_server.PywebsocketServer()) | 120 self.platform.StartLocalServer(pywebsocket_server.PywebsocketServer()) |
| 134 | 121 |
| 135 | 122 |
| 136 class BlinkPerfBindings(perf_benchmark.PerfBenchmark): | 123 class BlinkPerfBindings(perf_benchmark.PerfBenchmark): |
| 137 tag = 'bindings' | 124 tag = 'bindings' |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 225 |
| 239 def CreateStorySet(self, options): | 226 def CreateStorySet(self, options): |
| 240 path = os.path.join(BLINK_PERF_BASE_DIR, 'Layout') | 227 path = os.path.join(BLINK_PERF_BASE_DIR, 'Layout') |
| 241 return CreateStorySetFromPath(path, SKIPPED_FILE) | 228 return CreateStorySetFromPath(path, SKIPPED_FILE) |
| 242 | 229 |
| 243 @classmethod | 230 @classmethod |
| 244 def ShouldDisable(cls, possible_browser): | 231 def ShouldDisable(cls, possible_browser): |
| 245 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 | 232 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 |
| 246 | 233 |
| 247 | 234 |
| 248 @benchmark.Enabled('content-shell') | |
| 249 class BlinkPerfLayoutFullLayout(BlinkPerfLayout): | |
| 250 tag = 'layout_full_frame' | |
| 251 test = _BlinkPerfFullFrameMeasurement | |
| 252 | |
| 253 @classmethod | |
| 254 def Name(cls): | |
| 255 return 'blink_perf.layout_full_frame' | |
| 256 | |
| 257 | |
| 258 class BlinkPerfPaint(perf_benchmark.PerfBenchmark): | 235 class BlinkPerfPaint(perf_benchmark.PerfBenchmark): |
| 259 tag = 'paint' | 236 tag = 'paint' |
| 260 test = _BlinkPerfMeasurement | 237 test = _BlinkPerfMeasurement |
| 261 | 238 |
| 262 @classmethod | 239 @classmethod |
| 263 def Name(cls): | 240 def Name(cls): |
| 264 return 'blink_perf.paint' | 241 return 'blink_perf.paint' |
| 265 | 242 |
| 266 def CreateStorySet(self, options): | 243 def CreateStorySet(self, options): |
| 267 path = os.path.join(BLINK_PERF_BASE_DIR, 'Paint') | 244 path = os.path.join(BLINK_PERF_BASE_DIR, 'Paint') |
| (...skipping 21 matching lines...) Expand all Loading... |
| 289 | 266 |
| 290 @classmethod | 267 @classmethod |
| 291 def Name(cls): | 268 def Name(cls): |
| 292 return 'blink_perf.svg' | 269 return 'blink_perf.svg' |
| 293 | 270 |
| 294 def CreateStorySet(self, options): | 271 def CreateStorySet(self, options): |
| 295 path = os.path.join(BLINK_PERF_BASE_DIR, 'SVG') | 272 path = os.path.join(BLINK_PERF_BASE_DIR, 'SVG') |
| 296 return CreateStorySetFromPath(path, SKIPPED_FILE) | 273 return CreateStorySetFromPath(path, SKIPPED_FILE) |
| 297 | 274 |
| 298 | 275 |
| 299 @benchmark.Enabled('content-shell') | |
| 300 class BlinkPerfSVGFullLayout(BlinkPerfSVG): | |
| 301 tag = 'svg_full_frame' | |
| 302 test = _BlinkPerfFullFrameMeasurement | |
| 303 | |
| 304 @classmethod | |
| 305 def Name(cls): | |
| 306 return 'blink_perf.svg_full_frame' | |
| 307 | |
| 308 | |
| 309 class BlinkPerfShadowDOM(perf_benchmark.PerfBenchmark): | 276 class BlinkPerfShadowDOM(perf_benchmark.PerfBenchmark): |
| 310 tag = 'shadow_dom' | 277 tag = 'shadow_dom' |
| 311 test = _BlinkPerfMeasurement | 278 test = _BlinkPerfMeasurement |
| 312 | 279 |
| 313 @classmethod | 280 @classmethod |
| 314 def Name(cls): | 281 def Name(cls): |
| 315 return 'blink_perf.shadow_dom' | 282 return 'blink_perf.shadow_dom' |
| 316 | 283 |
| 317 def CreateStorySet(self, options): | 284 def CreateStorySet(self, options): |
| 318 path = os.path.join(BLINK_PERF_BASE_DIR, 'ShadowDOM') | 285 path = os.path.join(BLINK_PERF_BASE_DIR, 'ShadowDOM') |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return 'blink_perf.pywebsocket' | 319 return 'blink_perf.pywebsocket' |
| 353 | 320 |
| 354 def CreateStorySet(self, options): | 321 def CreateStorySet(self, options): |
| 355 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket') | 322 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket') |
| 356 return CreateStorySetFromPath(path, SKIPPED_FILE, | 323 return CreateStorySetFromPath(path, SKIPPED_FILE, |
| 357 shared_page_state_class=_SharedPywebsocketPageState) | 324 shared_page_state_class=_SharedPywebsocketPageState) |
| 358 | 325 |
| 359 @classmethod | 326 @classmethod |
| 360 def ShouldDisable(cls, possible_browser): | 327 def ShouldDisable(cls, possible_browser): |
| 361 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 | 328 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 |
| OLD | NEW |