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 telemetry import benchmark | 7 from telemetry import benchmark |
8 from telemetry.core import util | 8 from telemetry.core import util |
9 from telemetry.page import page_measurement | 9 from telemetry.page import page_measurement |
10 from telemetry.page import page_set | 10 from telemetry.page import page_set |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 | 57 |
58 class _BlinkPerfMeasurement(page_measurement.PageMeasurement): | 58 class _BlinkPerfMeasurement(page_measurement.PageMeasurement): |
59 """Tuns a blink performance test and reports the results.""" | 59 """Tuns a blink performance test and reports the results.""" |
60 def __init__(self): | 60 def __init__(self): |
61 super(_BlinkPerfMeasurement, self).__init__('') | 61 super(_BlinkPerfMeasurement, self).__init__('') |
62 with open(os.path.join(os.path.dirname(__file__), | 62 with open(os.path.join(os.path.dirname(__file__), |
63 'blink_perf.js'), 'r') as f: | 63 'blink_perf.js'), 'r') as f: |
64 self._blink_perf_js = f.read() | 64 self._blink_perf_js = f.read() |
65 | 65 |
66 @property | |
67 def results_are_the_same_on_every_page(self): | |
68 return False | |
69 | |
70 def WillNavigateToPage(self, page, tab): | 66 def WillNavigateToPage(self, page, tab): |
71 page.script_to_evaluate_on_commit = self._blink_perf_js | 67 page.script_to_evaluate_on_commit = self._blink_perf_js |
72 | 68 |
73 def CustomizeBrowserOptions(self, options): | 69 def CustomizeBrowserOptions(self, options): |
74 options.AppendExtraBrowserArgs([ | 70 options.AppendExtraBrowserArgs([ |
75 '--js-flags=--expose_gc', | 71 '--js-flags=--expose_gc', |
76 '--enable-experimental-web-platform-features', | 72 '--enable-experimental-web-platform-features', |
77 '--disable-gesture-requirement-for-media-playback' | 73 '--disable-gesture-requirement-for-media-playback' |
78 ]) | 74 ]) |
79 | 75 |
(...skipping 29 matching lines...) Expand all Loading... |
109 | 105 |
110 @benchmark.Disabled | 106 @benchmark.Disabled |
111 class BlinkPerfAnimation(benchmark.Benchmark): | 107 class BlinkPerfAnimation(benchmark.Benchmark): |
112 tag = 'animation' | 108 tag = 'animation' |
113 test = _BlinkPerfMeasurement | 109 test = _BlinkPerfMeasurement |
114 | 110 |
115 def CreatePageSet(self, options): | 111 def CreatePageSet(self, options): |
116 path = os.path.join(util.GetChromiumSrcDir(), | 112 path = os.path.join(util.GetChromiumSrcDir(), |
117 'third_party', 'WebKit', 'PerformanceTests', 'Animation') | 113 'third_party', 'WebKit', 'PerformanceTests', 'Animation') |
118 return _CreatePageSetFromPath(path) | 114 return _CreatePageSetFromPath(path) |
OLD | NEW |