| 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 time | 5 import time |
| 6 | 6 |
| 7 from measurements import smoothness | 7 from measurements import smoothness |
| 8 from telemetry.page import page_measurement | 8 from telemetry.page import page_measurement |
| 9 from telemetry.value import scalar |
| 10 |
| 9 | 11 |
| 10 class RecordPerArea(page_measurement.PageMeasurement): | 12 class RecordPerArea(page_measurement.PageMeasurement): |
| 11 def __init__(self): | 13 def __init__(self): |
| 12 super(RecordPerArea, self).__init__('', True) | 14 super(RecordPerArea, self).__init__('', True) |
| 13 | 15 |
| 14 def AddCommandLineArgs(self, parser): | 16 def AddCommandLineArgs(self, parser): |
| 15 parser.add_option('--start-wait-time', type='float', | 17 parser.add_option('--start-wait-time', type='float', |
| 16 default=2, | 18 default=2, |
| 17 help='Wait time before the benchmark is started ' | 19 help='Wait time before the benchmark is started ' |
| 18 '(must be long enought to load all content)') | 20 '(must be long enought to load all content)') |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 52 |
| 51 tab.WaitForJavaScriptExpression('window.benchmark_results.done', 300) | 53 tab.WaitForJavaScriptExpression('window.benchmark_results.done', 300) |
| 52 | 54 |
| 53 all_data = tab.EvaluateJavaScript('window.benchmark_results.results') | 55 all_data = tab.EvaluateJavaScript('window.benchmark_results.results') |
| 54 for data in all_data: | 56 for data in all_data: |
| 55 width = data['width'] | 57 width = data['width'] |
| 56 height = data['height'] | 58 height = data['height'] |
| 57 area = width * height | 59 area = width * height |
| 58 time_ms = data['time_ms'] | 60 time_ms = data['time_ms'] |
| 59 | 61 |
| 60 results.Add('area_%07d_%dx%d' % (area, width, height), 'ms', time_ms) | 62 results.AddValue(scalar.ScalarValue( |
| 61 | 63 results.current_page, 'area_%07d_%dx%d' % (area, width, height), |
| 64 'ms', time_ms)) |
| OLD | NEW |