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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return bool(tab.EvaluateJavaScript('__pc_load_time')) | 115 return bool(tab.EvaluateJavaScript('__pc_load_time')) |
116 util.WaitFor(_IsDone, 60) | 116 util.WaitFor(_IsDone, 60) |
117 | 117 |
118 for h in self._histograms: | 118 for h in self._histograms: |
119 h.GetValue(page, tab, results) | 119 h.GetValue(page, tab, results) |
120 | 120 |
121 results.Add('page_load_time', 'ms', | 121 results.Add('page_load_time', 'ms', |
122 int(float(tab.EvaluateJavaScript('__pc_load_time'))), | 122 int(float(tab.EvaluateJavaScript('__pc_load_time'))), |
123 chart_name='times') | 123 chart_name='times') |
124 | 124 |
125 def DidRunPageSet(self, tab, results): | 125 def DidRunTest(self, tab, results): |
126 self._memory_metrics.StopAndGetResults(tab.browser, results) | 126 self._memory_metrics.StopAndGetResults(tab.browser, results) |
127 self.MeasureIO(tab, results) | 127 self.MeasureIO(tab, results) |
OLD | NEW |