| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 self._v8_object_stats_metric.AddResults(tab, results) | 166 self._v8_object_stats_metric.AddResults(tab, results) |
| 167 | 167 |
| 168 if self._report_speed_index: | 168 if self._report_speed_index: |
| 169 def SpeedIndexIsFinished(): | 169 def SpeedIndexIsFinished(): |
| 170 return self._speedindex_metric.IsFinished(tab) | 170 return self._speedindex_metric.IsFinished(tab) |
| 171 util.WaitFor(SpeedIndexIsFinished, 60) | 171 util.WaitFor(SpeedIndexIsFinished, 60) |
| 172 self._speedindex_metric.Stop(page, tab) | 172 self._speedindex_metric.Stop(page, tab) |
| 173 self._speedindex_metric.AddResults( | 173 self._speedindex_metric.AddResults( |
| 174 tab, results, chart_name=chart_name_prefix+'speed_index') | 174 tab, results, chart_name=chart_name_prefix+'speed_index') |
| 175 | 175 |
| 176 def DidRunTest(self, tab, results): | 176 def DidRunTest(self, browser, results): |
| 177 self._memory_metric.AddSummaryResults(results) | 177 self._memory_metric.AddSummaryResults(results) |
| 178 io.IOMetric().AddSummaryResults(tab, results) | 178 io.IOMetric().AddSummaryResults(browser, results) |
| 179 | 179 |
| 180 def ShouldRunCold(self, url): | 180 def ShouldRunCold(self, url): |
| 181 # We do the warm runs first for two reasons. The first is so we can | 181 # We do the warm runs first for two reasons. The first is so we can |
| 182 # preserve any initial profile cache for as long as possible. | 182 # preserve any initial profile cache for as long as possible. |
| 183 # The second is that, if we did cold runs first, we'd have a transition | 183 # The second is that, if we did cold runs first, we'd have a transition |
| 184 # page set during which we wanted the run for each URL to both | 184 # page set during which we wanted the run for each URL to both |
| 185 # contribute to the cold data and warm the catch for the following | 185 # contribute to the cold data and warm the catch for the following |
| 186 # warm run, and clearing the cache before the load of the following | 186 # warm run, and clearing the cache before the load of the following |
| 187 # URL would eliminate the intended warmup for the previous URL. | 187 # URL would eliminate the intended warmup for the previous URL. |
| 188 return self._has_loaded_page[url] >= self._number_warm_runs + 1 | 188 return self._has_loaded_page[url] >= self._number_warm_runs + 1 |
| 189 | 189 |
| 190 def results_are_the_same_on_every_page(self): | 190 def results_are_the_same_on_every_page(self): |
| 191 return not self._cold_runs_requested | 191 return not self._cold_runs_requested |
| OLD | NEW |