Chromium Code Reviews| 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_set | 9 from telemetry.page import page_set |
| 10 from telemetry.page import page_test | 10 from telemetry.page import page_test |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 if candidate_path.startswith(tuple([os.path.join(path, s) | 33 if candidate_path.startswith(tuple([os.path.join(path, s) |
| 34 for s in skipped])): | 34 for s in skipped])): |
| 35 continue | 35 continue |
| 36 if os.path.isdir(candidate_path): | 36 if os.path.isdir(candidate_path): |
| 37 _AddDir(candidate_path, skipped) | 37 _AddDir(candidate_path, skipped) |
| 38 else: | 38 else: |
| 39 _AddPage(candidate_path) | 39 _AddPage(candidate_path) |
| 40 | 40 |
| 41 if os.path.isdir(path): | 41 if os.path.isdir(path): |
| 42 skipped = [] | 42 skipped = [] |
| 43 skipped_file = os.path.join(path, 'Skipped') | 43 skipped_file = os.path.join(path, 'Skipped') |
|
tonyg
2014/09/12 01:09:09
Does this still work?
tonyg
2014/09/12 14:12:50
Ping on this. If the skipped file is still respect
dtu
2014/09/15 21:01:13
You're right, this logic is flawed. Done.
| |
| 44 if os.path.exists(skipped_file): | 44 if os.path.exists(skipped_file): |
| 45 for line in open(skipped_file, 'r').readlines(): | 45 for line in open(skipped_file, 'r').readlines(): |
| 46 line = line.strip() | 46 line = line.strip() |
| 47 if line and not line.startswith('#'): | 47 if line and not line.startswith('#'): |
| 48 skipped.append(line.replace('/', os.sep)) | 48 skipped.append(line.replace('/', os.sep)) |
| 49 _AddDir(path, skipped) | 49 _AddDir(path, skipped) |
| 50 else: | 50 else: |
| 51 _AddPage(path) | 51 _AddPage(path) |
| 52 ps = page_set.PageSet(file_path=os.getcwd()+os.sep, serving_dirs=serving_dirs) | 52 ps = page_set.PageSet(file_path=os.getcwd()+os.sep, serving_dirs=serving_dirs) |
| 53 for url in page_urls: | 53 for url in page_urls: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 units = parts[-1] | 86 units = parts[-1] |
| 87 metric = page.display_name.split('.')[0].replace('/', '_') | 87 metric = page.display_name.split('.')[0].replace('/', '_') |
| 88 results.AddValue(list_of_scalar_values.ListOfScalarValues( | 88 results.AddValue(list_of_scalar_values.ListOfScalarValues( |
| 89 results.current_page, metric, units, values)) | 89 results.current_page, metric, units, values)) |
| 90 | 90 |
| 91 break | 91 break |
| 92 | 92 |
| 93 print log | 93 print log |
| 94 | 94 |
| 95 | 95 |
| 96 @benchmark.Disabled('android') | |
|
tonyg
2014/09/12 01:09:09
Please add a TODO indicating that once the desktop
dtu
2014/09/12 03:18:52
Done.
| |
| 96 class BlinkPerfAll(benchmark.Benchmark): | 97 class BlinkPerfAll(benchmark.Benchmark): |
| 97 tag = 'all' | 98 tag = 'all' |
| 98 test = _BlinkPerfMeasurement | 99 test = _BlinkPerfMeasurement |
| 99 | 100 |
| 100 def CreatePageSet(self, options): | 101 def CreatePageSet(self, options): |
| 101 path = os.path.join(util.GetChromiumSrcDir(), | 102 path = os.path.join(util.GetChromiumSrcDir(), |
| 102 'third_party', 'WebKit', 'PerformanceTests') | 103 'third_party', 'WebKit', 'PerformanceTests') |
| 103 return _CreatePageSetFromPath(path) | 104 return _CreatePageSetFromPath(path) |
| 104 | 105 |
| 105 | 106 |
| 106 @benchmark.Disabled | 107 @benchmark.Enabled('android') |
| 107 class BlinkPerfAnimation(benchmark.Benchmark): | 108 class BlinkPerfAnimation(benchmark.Benchmark): |
| 108 tag = 'animation' | 109 tag = 'animation' |
| 109 test = _BlinkPerfMeasurement | 110 test = _BlinkPerfMeasurement |
| 110 | 111 |
| 111 def CreatePageSet(self, options): | 112 def CreatePageSet(self, options): |
| 112 path = os.path.join(util.GetChromiumSrcDir(), | 113 path = os.path.join(util.GetChromiumSrcDir(), |
| 113 'third_party', 'WebKit', 'PerformanceTests', 'Animation') | 114 'third_party', 'WebKit', 'PerformanceTests', 'Animation') |
| 114 return _CreatePageSetFromPath(path) | 115 return _CreatePageSetFromPath(path) |
| 116 | |
| 117 | |
| 118 @benchmark.Enabled('android') | |
| 119 class BlinkPerfBindings(benchmark.Benchmark): | |
| 120 tag = 'bindings' | |
| 121 test = _BlinkPerfMeasurement | |
| 122 | |
| 123 def CreatePageSet(self, options): | |
| 124 path = os.path.join(util.GetChromiumSrcDir(), | |
| 125 'third_party', 'WebKit', 'PerformanceTests', 'Bindings') | |
|
tonyg
2014/09/12 01:09:09
I'm on the fence about whether these dir names sho
dtu
2014/09/12 03:18:52
Pros:
- Much shorter code. Easy to glance at list
tonyg
2014/09/12 14:12:50
Makes sense. I agree with your approach.
| |
| 126 return _CreatePageSetFromPath(path) | |
| 127 | |
| 128 | |
| 129 @benchmark.Enabled('android') | |
| 130 class BlinkPerfCSS(benchmark.Benchmark): | |
| 131 tag = 'css' | |
| 132 test = _BlinkPerfMeasurement | |
| 133 | |
| 134 def CreatePageSet(self, options): | |
| 135 path = os.path.join(util.GetChromiumSrcDir(), | |
| 136 'third_party', 'WebKit', 'PerformanceTests', 'CSS') | |
| 137 return _CreatePageSetFromPath(path) | |
| 138 | |
| 139 | |
| 140 @benchmark.Enabled('android') | |
| 141 class BlinkPerfCanvas(benchmark.Benchmark): | |
| 142 tag = 'canvas' | |
| 143 test = _BlinkPerfMeasurement | |
| 144 | |
| 145 def CreatePageSet(self, options): | |
| 146 path = os.path.join(util.GetChromiumSrcDir(), | |
| 147 'third_party', 'WebKit', 'PerformanceTests', 'Canvas') | |
| 148 return _CreatePageSetFromPath(path) | |
| 149 | |
| 150 | |
| 151 @benchmark.Enabled('android') | |
| 152 class BlinkPerfDOM(benchmark.Benchmark): | |
| 153 tag = 'dom' | |
| 154 test = _BlinkPerfMeasurement | |
| 155 | |
| 156 def CreatePageSet(self, options): | |
| 157 path = os.path.join(util.GetChromiumSrcDir(), | |
| 158 'third_party', 'WebKit', 'PerformanceTests', 'DOM') | |
| 159 return _CreatePageSetFromPath(path) | |
| 160 | |
| 161 | |
| 162 @benchmark.Enabled('android') | |
| 163 class BlinkPerfEvents(benchmark.Benchmark): | |
| 164 tag = 'events' | |
| 165 test = _BlinkPerfMeasurement | |
| 166 | |
| 167 def CreatePageSet(self, options): | |
| 168 path = os.path.join(util.GetChromiumSrcDir(), | |
| 169 'third_party', 'WebKit', 'PerformanceTests', 'Events') | |
| 170 return _CreatePageSetFromPath(path) | |
| 171 | |
| 172 | |
| 173 @benchmark.Enabled('android') | |
| 174 class BlinkPerfInteractive(benchmark.Benchmark): | |
| 175 tag = 'interactive' | |
| 176 test = _BlinkPerfMeasurement | |
| 177 | |
| 178 def CreatePageSet(self, options): | |
| 179 path = os.path.join(util.GetChromiumSrcDir(), | |
| 180 'third_party', 'WebKit', 'PerformanceTests', 'Interactive') | |
| 181 return _CreatePageSetFromPath(path) | |
| 182 | |
| 183 | |
| 184 @benchmark.Enabled('android') | |
| 185 class BlinkPerfLayout(benchmark.Benchmark): | |
| 186 tag = 'layout' | |
| 187 test = _BlinkPerfMeasurement | |
| 188 | |
| 189 def CreatePageSet(self, options): | |
| 190 path = os.path.join(util.GetChromiumSrcDir(), | |
| 191 'third_party', 'WebKit', 'PerformanceTests', 'Layout') | |
| 192 return _CreatePageSetFromPath(path) | |
| 193 | |
| 194 | |
| 195 @benchmark.Enabled('android') | |
| 196 class BlinkPerfMutation(benchmark.Benchmark): | |
| 197 tag = 'mutation' | |
| 198 test = _BlinkPerfMeasurement | |
| 199 | |
| 200 def CreatePageSet(self, options): | |
| 201 path = os.path.join(util.GetChromiumSrcDir(), | |
| 202 'third_party', 'WebKit', 'PerformanceTests', 'Mutation') | |
| 203 return _CreatePageSetFromPath(path) | |
| 204 | |
| 205 | |
| 206 @benchmark.Enabled('android') | |
| 207 class BlinkPerfParser(benchmark.Benchmark): | |
| 208 tag = 'parser' | |
| 209 test = _BlinkPerfMeasurement | |
| 210 | |
| 211 def CreatePageSet(self, options): | |
| 212 path = os.path.join(util.GetChromiumSrcDir(), | |
| 213 'third_party', 'WebKit', 'PerformanceTests', 'Parser') | |
| 214 return _CreatePageSetFromPath(path) | |
| 215 | |
| 216 | |
| 217 @benchmark.Enabled('android') | |
| 218 class BlinkPerfSVG(benchmark.Benchmark): | |
| 219 tag = 'svg' | |
| 220 test = _BlinkPerfMeasurement | |
| 221 | |
| 222 def CreatePageSet(self, options): | |
| 223 path = os.path.join(util.GetChromiumSrcDir(), | |
| 224 'third_party', 'WebKit', 'PerformanceTests', 'SVG') | |
| 225 return _CreatePageSetFromPath(path) | |
| 226 | |
| 227 | |
| 228 @benchmark.Enabled('android') | |
| 229 class BlinkPerfShadowDOM(benchmark.Benchmark): | |
| 230 tag = 'shadow_dom' | |
| 231 test = _BlinkPerfMeasurement | |
| 232 | |
| 233 def CreatePageSet(self, options): | |
| 234 path = os.path.join(util.GetChromiumSrcDir(), | |
| 235 'third_party', 'WebKit', 'PerformanceTests', 'ShadowDOM') | |
| 236 return _CreatePageSetFromPath(path) | |
| 237 | |
| 238 | |
| 239 @benchmark.Enabled('android') | |
| 240 class BlinkPerfXMLHttpRequest(benchmark.Benchmark): | |
| 241 tag = 'xml_http_request' | |
| 242 test = _BlinkPerfMeasurement | |
| 243 | |
| 244 def CreatePageSet(self, options): | |
| 245 path = os.path.join(util.GetChromiumSrcDir(), | |
| 246 'third_party', 'WebKit', 'PerformanceTests', 'XMLHttpRequest') | |
| 247 return _CreatePageSetFromPath(path) | |
| OLD | NEW |