| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 re | 5 import re |
| 6 | 6 |
| 7 import page_sets | 7 import page_sets |
| 8 | 8 |
| 9 from core import perf_benchmark | 9 from core import perf_benchmark |
| 10 from telemetry import benchmark | 10 from telemetry import benchmark |
| 11 from telemetry.page import legacy_page_test | 11 from telemetry.page import legacy_page_test |
| 12 from telemetry.value import scalar | 12 from telemetry.value import scalar |
| 13 from telemetry.value import improvement_direction | 13 from telemetry.value import improvement_direction |
| 14 from telemetry.timeline import chrome_trace_category_filter | 14 from telemetry.timeline import chrome_trace_category_filter |
| 15 from telemetry.timeline import chrome_trace_config | 15 from telemetry.timeline import chrome_trace_config |
| 16 from telemetry.web_perf import timeline_based_measurement | 16 from telemetry.web_perf import timeline_based_measurement |
| 17 | 17 |
| 18 | 18 |
| 19 class _OortOnlineMeasurement(legacy_page_test.LegacyPageTest): | 19 class _OortOnlineMeasurement(legacy_page_test.LegacyPageTest): |
| 20 | 20 |
| 21 def __init__(self): | 21 def __init__(self): |
| 22 super(_OortOnlineMeasurement, self).__init__() | 22 super(_OortOnlineMeasurement, self).__init__() |
| 23 | 23 |
| 24 def ValidateAndMeasurePage(self, page, tab, results): | 24 def ValidateAndMeasurePage(self, page, tab, results): |
| 25 del page # unused | 25 del page # unused |
| 26 tab.WaitForJavaScriptCondition2('window.benchmarkFinished', timeout=1000) | 26 tab.WaitForJavaScriptCondition('window.benchmarkFinished', timeout=1000) |
| 27 scores = tab.EvaluateJavaScript2('window.benchmarkScore') | 27 scores = tab.EvaluateJavaScript('window.benchmarkScore') |
| 28 for score in scores: | 28 for score in scores: |
| 29 valid = score['valid'] | 29 valid = score['valid'] |
| 30 if valid: | 30 if valid: |
| 31 results.AddValue(scalar.ScalarValue( | 31 results.AddValue(scalar.ScalarValue( |
| 32 results.current_page, score['name'], 'score', score['score'], | 32 results.current_page, score['name'], 'score', score['score'], |
| 33 important=True, improvement_direction=improvement_direction.UP)) | 33 important=True, improvement_direction=improvement_direction.UP)) |
| 34 | 34 |
| 35 | 35 |
| 36 @benchmark.Disabled('android') | 36 @benchmark.Disabled('android') |
| 37 class OortOnline(perf_benchmark.PerfBenchmark): | 37 class OortOnline(perf_benchmark.PerfBenchmark): |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 def Name(cls): | 102 def Name(cls): |
| 103 return 'oortonline_tbmv2' | 103 return 'oortonline_tbmv2' |
| 104 | 104 |
| 105 @classmethod | 105 @classmethod |
| 106 def ValueCanBeAddedPredicate(cls, value, _): | 106 def ValueCanBeAddedPredicate(cls, value, _): |
| 107 if 'memory:chrome' in value.name: | 107 if 'memory:chrome' in value.name: |
| 108 return bool(cls._V8_AND_OVERALL_MEMORY_RE.search(value.name)) | 108 return bool(cls._V8_AND_OVERALL_MEMORY_RE.search(value.name)) |
| 109 if 'animation ' in value.name: | 109 if 'animation ' in value.name: |
| 110 return 'throughput' in value.name or 'frameTimeDiscrepancy' in value.name | 110 return 'throughput' in value.name or 'frameTimeDiscrepancy' in value.name |
| 111 return 'v8' in value.name | 111 return 'v8' in value.name |
| OLD | NEW |