| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 unittest | 5 import unittest |
| 6 | 6 |
| 7 import metrics | 7 import metrics |
| 8 import report | 8 import report |
| 9 from queuing_lens import QueuingLens | 9 from queuing_lens import QueuingLens |
| 10 import test_utils | 10 import test_utils |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 {'ts': self._CONTENTFUL_PAINT * self.MILLI_TO_MICRO, 'ph': 'I', | 58 {'ts': self._CONTENTFUL_PAINT * self.MILLI_TO_MICRO, 'ph': 'I', |
| 59 'cat': 'blink.user_timing', 'pid': 1, 'tid': 1, | 59 'cat': 'blink.user_timing', 'pid': 1, 'tid': 1, |
| 60 'name': 'firstContentfulPaint', | 60 'name': 'firstContentfulPaint', |
| 61 'args': {'frame': self._MAIN_FRAME_ID}}, | 61 'args': {'frame': self._MAIN_FRAME_ID}}, |
| 62 {'ts': self._TEXT_PAINT * self.MILLI_TO_MICRO, 'ph': 'I', | 62 {'ts': self._TEXT_PAINT * self.MILLI_TO_MICRO, 'ph': 'I', |
| 63 'cat': 'blink.user_timing', 'pid': 1, 'tid': 1, | 63 'cat': 'blink.user_timing', 'pid': 1, 'tid': 1, |
| 64 'name': 'firstPaint', | 64 'name': 'firstPaint', |
| 65 'args': {'frame': self._MAIN_FRAME_ID}}, | 65 'args': {'frame': self._MAIN_FRAME_ID}}, |
| 66 {'ts': 90 * self.MILLI_TO_MICRO, 'ph': 'I', | 66 {'ts': 90 * self.MILLI_TO_MICRO, 'ph': 'I', |
| 67 'cat': 'blink', 'pid': 1, 'tid': 1, | 67 'cat': 'blink', 'pid': 1, 'tid': 1, |
| 68 'name': 'FrameView::synchronizedPaint'}, | 68 'name': 'FrameView::paintTree'}, |
| 69 {'ts': self._SIGNIFICANT_PAINT * self.MILLI_TO_MICRO, 'ph': 'I', | 69 {'ts': self._SIGNIFICANT_PAINT * self.MILLI_TO_MICRO, 'ph': 'I', |
| 70 'cat': 'foobar', 'name': 'biz', 'pid': 1, 'tid': 1, | 70 'cat': 'foobar', 'name': 'biz', 'pid': 1, 'tid': 1, |
| 71 'args': {'counters': { | 71 'args': {'counters': { |
| 72 'LayoutObjectsThatHadNeverHadLayout': 10}}}, | 72 'LayoutObjectsThatHadNeverHadLayout': 10}}}, |
| 73 {'ts': (self._NAVIGATION_START_TIME - self._TOPLEVEL_EVENT_OFFSET) | 73 {'ts': (self._NAVIGATION_START_TIME - self._TOPLEVEL_EVENT_OFFSET) |
| 74 * self.MILLI_TO_MICRO, | 74 * self.MILLI_TO_MICRO, |
| 75 'pid': 1, 'tid': 1, 'ph': 'X', | 75 'pid': 1, 'tid': 1, 'ph': 'X', |
| 76 'dur': self._TOPLEVEL_EVENT_DURATION * self.MILLI_TO_MICRO, | 76 'dur': self._TOPLEVEL_EVENT_DURATION * self.MILLI_TO_MICRO, |
| 77 'cat': 'toplevel', 'name': 'MessageLoop::RunTask'}, | 77 'cat': 'toplevel', 'name': 'MessageLoop::RunTask'}, |
| 78 {'ts': self._NAVIGATION_START_TIME * self.MILLI_TO_MICRO, | 78 {'ts': self._NAVIGATION_START_TIME * self.MILLI_TO_MICRO, |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 BASE_MSEC + 2, BASE_MSEC + 12, BASE_MSEC + 22) | 289 BASE_MSEC + 2, BASE_MSEC + 12, BASE_MSEC + 22) |
| 290 loading_report = report.LoadingReport(self._MakeTrace()).GenerateReport() | 290 loading_report = report.LoadingReport(self._MakeTrace()).GenerateReport() |
| 291 self.assertEqual(15, loading_report['total_queuing_blocked_msec']) | 291 self.assertEqual(15, loading_report['total_queuing_blocked_msec']) |
| 292 self.assertEqual(35, loading_report['total_queuing_load_msec']) | 292 self.assertEqual(35, loading_report['total_queuing_load_msec']) |
| 293 self.assertAlmostEqual(1, loading_report['average_blocking_request_count']) | 293 self.assertAlmostEqual(1, loading_report['average_blocking_request_count']) |
| 294 self.assertEqual(1, loading_report['median_blocking_request_count']) | 294 self.assertEqual(1, loading_report['median_blocking_request_count']) |
| 295 | 295 |
| 296 | 296 |
| 297 if __name__ == '__main__': | 297 if __name__ == '__main__': |
| 298 unittest.main() | 298 unittest.main() |
| OLD | NEW |