| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """The page cycler measurement. | 5 """The page cycler measurement. |
| 6 | 6 |
| 7 This measurement registers a window load handler in which is forces a layout and | 7 This measurement registers a window load handler in which is forces a layout and |
| 8 then records the value of performance.now(). This call to now() measures the | 8 then records the value of performance.now(). This call to now() measures the |
| 9 time from navigationStart (immediately after the previous page's beforeunload | 9 time from navigationStart (immediately after the previous page's beforeunload |
| 10 event) until after the layout in the page's load event. In addition, two garbage | 10 event) until after the layout in the page's load event. In addition, two garbage |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 tab.ClearCache() | 75 tab.ClearCache() |
| 76 | 76 |
| 77 def DidNavigateToPage(self, page, tab): | 77 def DidNavigateToPage(self, page, tab): |
| 78 self._memory_metric.Start(page, tab) | 78 self._memory_metric.Start(page, tab) |
| 79 if self._record_v8_object_stats: | 79 if self._record_v8_object_stats: |
| 80 self._v8_object_stats_metric.Start(page, tab) | 80 self._v8_object_stats_metric.Start(page, tab) |
| 81 | 81 |
| 82 def CustomizeBrowserOptions(self, options): | 82 def CustomizeBrowserOptions(self, options): |
| 83 memory.MemoryMetric.CustomizeBrowserOptions(options) | 83 memory.MemoryMetric.CustomizeBrowserOptions(options) |
| 84 io.IOMetric.CustomizeBrowserOptions(options) | 84 io.IOMetric.CustomizeBrowserOptions(options) |
| 85 options.AppendExtraBrowserArg('--js-flags=--expose_gc') | 85 options.AppendExtraBrowserArgs('--js-flags=--expose_gc') |
| 86 | 86 |
| 87 if options.v8_object_stats: | 87 if options.v8_object_stats: |
| 88 self._record_v8_object_stats = True | 88 self._record_v8_object_stats = True |
| 89 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options) | 89 v8_object_stats.V8ObjectStatsMetric.CustomizeBrowserOptions(options) |
| 90 | 90 |
| 91 # A disk cache bug causes some page cyclers to hang on mac. | 91 # A disk cache bug causes some page cyclers to hang on mac. |
| 92 # TODO(tonyg): Re-enable these tests when crbug.com/268646 is fixed. | 92 # TODO(tonyg): Re-enable these tests when crbug.com/268646 is fixed. |
| 93 if (sys.platform == 'darwin' and | 93 if (sys.platform == 'darwin' and |
| 94 (sys.argv[-1].endswith('/intl_hi_ru.json') or | 94 (sys.argv[-1].endswith('/intl_hi_ru.json') or |
| 95 sys.argv[-1].endswith('/tough_layout_cases.json') or | 95 sys.argv[-1].endswith('/tough_layout_cases.json') or |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 # preserve any initial profile cache for as long as possible. | 151 # preserve any initial profile cache for as long as possible. |
| 152 # The second is that, if we did cold runs first, we'd have a transition | 152 # The second is that, if we did cold runs first, we'd have a transition |
| 153 # page set during which we wanted the run for each URL to both | 153 # page set during which we wanted the run for each URL to both |
| 154 # contribute to the cold data and warm the catch for the following | 154 # contribute to the cold data and warm the catch for the following |
| 155 # warm run, and clearing the cache before the load of the following | 155 # warm run, and clearing the cache before the load of the following |
| 156 # URL would eliminate the intended warmup for the previous URL. | 156 # URL would eliminate the intended warmup for the previous URL. |
| 157 return self._has_loaded_page[url] >= self._number_warm_runs + 1 | 157 return self._has_loaded_page[url] >= self._number_warm_runs + 1 |
| 158 | 158 |
| 159 def results_are_the_same_on_every_page(self): | 159 def results_are_the_same_on_every_page(self): |
| 160 return not self._cold_runs_requested | 160 return not self._cold_runs_requested |
| OLD | NEW |