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 sys | 5 import sys |
| 6 import time | 6 import time |
| 7 | 7 |
| 8 from telemetry.core.util import TimeoutException | 8 from telemetry.core.util import TimeoutException |
| 9 from telemetry.page import page_measurement | 9 from telemetry.page import page_measurement |
| 10 from telemetry.page import page_test | 10 from telemetry.page import page_test |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 backend = browser._browser_backend # pylint: disable=W0212 | 51 backend = browser._browser_backend # pylint: disable=W0212 |
| 52 self._chrome_branch_number = getattr(backend, 'chrome_branch_number', None) | 52 self._chrome_branch_number = getattr(backend, 'chrome_branch_number', None) |
| 53 if (not self._chrome_branch_number or | 53 if (not self._chrome_branch_number or |
| 54 (sys.platform != 'android' and self._chrome_branch_number < 1713)): | 54 (sys.platform != 'android' and self._chrome_branch_number < 1713)): |
| 55 raise page_test.TestNotSupportedOnPlatformFailure( | 55 raise page_test.TestNotSupportedOnPlatformFailure( |
| 56 'rasterize_and_record_micro requires Chrome branch 1713 ' | 56 'rasterize_and_record_micro requires Chrome branch 1713 ' |
| 57 'or later. Skipping measurement.') | 57 'or later. Skipping measurement.') |
| 58 | 58 |
| 59 def MeasurePage(self, page, tab, results): | 59 def MeasurePage(self, page, tab, results): |
| 60 try: | 60 try: |
| 61 tab.WaitForJavaScriptExpression("document.readyState == 'complete'", 10) | 61 tab.WaitForJavaScriptExpression("document.readyState == 'complete'", 30) |
|
tonyg
2014/07/17 17:02:02
Good catch. Let's change this to:
tab.WaitForDo
gordanac
2014/07/18 09:25:58
Done.
| |
| 62 except TimeoutException: | 62 except TimeoutException: |
| 63 pass | 63 pass |
| 64 time.sleep(self.options.start_wait_time) | 64 time.sleep(self.options.start_wait_time) |
| 65 | 65 |
| 66 record_repeat = self.options.record_repeat | 66 record_repeat = self.options.record_repeat |
| 67 rasterize_repeat = self.options.rasterize_repeat | 67 rasterize_repeat = self.options.rasterize_repeat |
| 68 # Enqueue benchmark | 68 # Enqueue benchmark |
| 69 tab.ExecuteJavaScript(""" | 69 tab.ExecuteJavaScript(""" |
| 70 window.benchmark_results = {}; | 70 window.benchmark_results = {}; |
| 71 window.benchmark_results.done = false; | 71 window.benchmark_results.done = false; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 results.current_page, 'total_layers', 'count', total_layers)) | 144 results.current_page, 'total_layers', 'count', total_layers)) |
| 145 results.AddValue(scalar.ScalarValue( | 145 results.AddValue(scalar.ScalarValue( |
| 146 results.current_page, 'total_picture_layers', 'count', | 146 results.current_page, 'total_picture_layers', 'count', |
| 147 total_picture_layers)) | 147 total_picture_layers)) |
| 148 results.AddValue(scalar.ScalarValue( | 148 results.AddValue(scalar.ScalarValue( |
| 149 results.current_page, 'total_picture_layers_with_no_content', 'count', | 149 results.current_page, 'total_picture_layers_with_no_content', 'count', |
| 150 total_picture_layers_with_no_content)) | 150 total_picture_layers_with_no_content)) |
| 151 results.AddValue(scalar.ScalarValue( | 151 results.AddValue(scalar.ScalarValue( |
| 152 results.current_page, 'total_picture_layers_off_screen', 'count', | 152 results.current_page, 'total_picture_layers_off_screen', 'count', |
| 153 total_picture_layers_off_screen)) | 153 total_picture_layers_off_screen)) |
| OLD | NEW |