| OLD | NEW |
| 1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2012 Zoltan Horvath, Adobe Systems Incorporated. All rights rese
rved. | 2 # Copyright (C) 2012 Zoltan Horvath, Adobe Systems Incorporated. All rights rese
rved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return True | 191 return True |
| 192 | 192 |
| 193 def _ensure_metrics(self, metric_name, unit=None): | 193 def _ensure_metrics(self, metric_name, unit=None): |
| 194 if metric_name not in self._metrics: | 194 if metric_name not in self._metrics: |
| 195 self._metrics[metric_name] = PerfTestMetric(metric_name, unit) | 195 self._metrics[metric_name] = PerfTestMetric(metric_name, unit) |
| 196 self._ordered_metrics_name.append(metric_name) | 196 self._ordered_metrics_name.append(metric_name) |
| 197 return self._metrics[metric_name] | 197 return self._metrics[metric_name] |
| 198 | 198 |
| 199 def run_single(self, driver, test_path, time_out_ms, should_run_pixel_test=F
alse): | 199 def run_single(self, driver, test_path, time_out_ms, should_run_pixel_test=F
alse): |
| 200 return driver.run_test( | 200 return driver.run_test( |
| 201 DriverInput(test_path, time_out_ms, image_hash=None, should_run_pixe
l_test=should_run_pixel_test, args=[]), stop_when_done=False) | 201 DriverInput(test_path, |
| 202 time_out_ms, |
| 203 image_hash=None, |
| 204 should_run_pixel_test=should_run_pixel_test, |
| 205 args=[]), |
| 206 stop_when_done=False) |
| 202 | 207 |
| 203 def run_failed(self, output): | 208 def run_failed(self, output): |
| 204 if output.error: | 209 if output.error: |
| 205 _log.error('error: %s\n%s', self.test_name(), output.error) | 210 _log.error('error: %s\n%s', self.test_name(), output.error) |
| 206 | 211 |
| 207 if output.text is None: | 212 if output.text is None: |
| 208 pass | 213 pass |
| 209 elif output.timeout: | 214 elif output.timeout: |
| 210 _log.error('timeout: %s', self.test_name()) | 215 _log.error('timeout: %s', self.test_name()) |
| 211 elif output.crash: | 216 elif output.crash: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 239 re.compile(r'^\s*Ignoring warm-up '), | 244 re.compile(r'^\s*Ignoring warm-up '), |
| 240 re.compile(r'^\s*Info:'), | 245 re.compile(r'^\s*Info:'), |
| 241 re.compile(r'^\s*\d+(.\d+)?(\s*(runs\/s|ms|fps))?$'), | 246 re.compile(r'^\s*\d+(.\d+)?(\s*(runs\/s|ms|fps))?$'), |
| 242 # Following are for handle existing test like Dromaeo | 247 # Following are for handle existing test like Dromaeo |
| 243 re.compile(re.escape("""main frame - has 1 onunload handler(s)""")), | 248 re.compile(re.escape("""main frame - has 1 onunload handler(s)""")), |
| 244 re.compile(re.escape("""frame "<!--framePath //<!--frame0-->-->" - has 1
onunload handler(s)""")), | 249 re.compile(re.escape("""frame "<!--framePath //<!--frame0-->-->" - has 1
onunload handler(s)""")), |
| 245 re.compile(re.escape("""frame "<!--framePath //<!--frame0-->/<!--frame0-
->-->" - has 1 onunload handler(s)""")), | 250 re.compile(re.escape("""frame "<!--framePath //<!--frame0-->/<!--frame0-
->-->" - has 1 onunload handler(s)""")), |
| 246 # Following is for html5.html | 251 # Following is for html5.html |
| 247 re.compile(re.escape("""Blocked access to external URL http://www.whatwg
.org/specs/web-apps/current-work/""")), | 252 re.compile(re.escape("""Blocked access to external URL http://www.whatwg
.org/specs/web-apps/current-work/""")), |
| 248 re.compile( | 253 re.compile( |
| 249 r"CONSOLE MESSAGE: (line \d+: )?Blocked script execution in '[A-Za-z
0-9\-\.:]+' because the document's frame is sandboxed and the 'allow-scripts' pe
rmission is not set."), | 254 r"CONSOLE MESSAGE: (line \d+: )?Blocked script execution in '[A-Za-z
0-9\-\.:]+' " |
| 255 "because the document's frame is sandboxed and the 'allow-scripts' p
ermission is not set."), |
| 250 re.compile(r"CONSOLE MESSAGE: (line \d+: )?Not allowed to load local res
ource"), | 256 re.compile(r"CONSOLE MESSAGE: (line \d+: )?Not allowed to load local res
ource"), |
| 251 # Dromaeo reports values for subtests. Ignore them for now. | 257 # Dromaeo reports values for subtests. Ignore them for now. |
| 252 re.compile(r'(?P<name>.+): \[(?P<values>(\d+(.\d+)?,\s+)*\d+(.\d+)?)\]')
, | 258 re.compile(r'(?P<name>.+): \[(?P<values>(\d+(.\d+)?,\s+)*\d+(.\d+)?)\]')
, |
| 253 ] | 259 ] |
| 254 | 260 |
| 255 def _filter_output(self, output): | 261 def _filter_output(self, output): |
| 256 if output.error: | 262 if output.error: |
| 257 output.error = '\n'.join([line for line in re.split('\n', output.err
or) | 263 output.error = '\n'.join([line for line in re.split('\n', output.err
or) |
| 258 if not self._should_ignore_line(self._line
s_to_ignore_in_stderr, line)]) | 264 if not self._should_ignore_line(self._line
s_to_ignore_in_stderr, line)]) |
| 259 if output.text: | 265 if output.text: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 (re.compile(r'^Dromaeo/'), SingleProcessPerfTest), | 313 (re.compile(r'^Dromaeo/'), SingleProcessPerfTest), |
| 308 (re.compile(r'^inspector/'), ChromiumStylePerfTest), | 314 (re.compile(r'^inspector/'), ChromiumStylePerfTest), |
| 309 ] | 315 ] |
| 310 | 316 |
| 311 @classmethod | 317 @classmethod |
| 312 def create_perf_test(cls, port, test_name, path, test_runner_count=DEFAULT_T
EST_RUNNER_COUNT): | 318 def create_perf_test(cls, port, test_name, path, test_runner_count=DEFAULT_T
EST_RUNNER_COUNT): |
| 313 for (pattern, test_class) in cls._pattern_map: | 319 for (pattern, test_class) in cls._pattern_map: |
| 314 if pattern.match(test_name): | 320 if pattern.match(test_name): |
| 315 return test_class(port, test_name, path, test_runner_count) | 321 return test_class(port, test_name, path, test_runner_count) |
| 316 return PerfTest(port, test_name, path, test_runner_count) | 322 return PerfTest(port, test_name, path, test_runner_count) |
| OLD | NEW |