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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 class _BlinkPerfMeasurement(page_test.PageTest): | 74 class _BlinkPerfMeasurement(page_test.PageTest): |
75 """Tuns a blink performance test and reports the results.""" | 75 """Tuns a blink performance test and reports the results.""" |
76 | 76 |
77 def __init__(self): | 77 def __init__(self): |
78 super(_BlinkPerfMeasurement, self).__init__() | 78 super(_BlinkPerfMeasurement, self).__init__() |
79 with open(os.path.join(os.path.dirname(__file__), | 79 with open(os.path.join(os.path.dirname(__file__), |
80 'blink_perf.js'), 'r') as f: | 80 'blink_perf.js'), 'r') as f: |
81 self._blink_perf_js = f.read() | 81 self._blink_perf_js = f.read() |
82 | 82 |
83 def WillNavigateToPage(self, page, tab): | 83 def WillNavigateToPage(self, page, tab): |
| 84 del tab # unused |
84 page.script_to_evaluate_on_commit = self._blink_perf_js | 85 page.script_to_evaluate_on_commit = self._blink_perf_js |
85 | 86 |
86 def CustomizeBrowserOptions(self, options): | 87 def CustomizeBrowserOptions(self, options): |
87 options.AppendExtraBrowserArgs([ | 88 options.AppendExtraBrowserArgs([ |
88 '--js-flags=--expose_gc', | 89 '--js-flags=--expose_gc', |
89 '--enable-experimental-web-platform-features', | 90 '--enable-experimental-web-platform-features', |
90 '--disable-gesture-requirement-for-media-playback', | 91 '--disable-gesture-requirement-for-media-playback', |
91 '--enable-experimental-canvas-features', | 92 '--enable-experimental-canvas-features', |
92 # TODO(qinmin): After fixing crbug.com/592017, remove this command line. | 93 # TODO(qinmin): After fixing crbug.com/592017, remove this command line. |
93 '--reduce-security-for-testing' | 94 '--reduce-security-for-testing' |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 334 |
334 def CreateStorySet(self, options): | 335 def CreateStorySet(self, options): |
335 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket') | 336 path = os.path.join(BLINK_PERF_BASE_DIR, 'Pywebsocket') |
336 return CreateStorySetFromPath( | 337 return CreateStorySetFromPath( |
337 path, SKIPPED_FILE, | 338 path, SKIPPED_FILE, |
338 shared_page_state_class=_SharedPywebsocketPageState) | 339 shared_page_state_class=_SharedPywebsocketPageState) |
339 | 340 |
340 @classmethod | 341 @classmethod |
341 def ShouldDisable(cls, possible_browser): | 342 def ShouldDisable(cls, possible_browser): |
342 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 | 343 return cls.IsSvelte(possible_browser) # http://crbug.com/551950 |
OLD | NEW |