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 import sys | 4 import sys |
5 | 5 |
6 from measurements import smoothness | 6 from measurements import smoothness |
7 from telemetry.core import wpr_modes | 7 from telemetry.core import wpr_modes |
8 from telemetry.page import page | 8 from telemetry.page import page |
9 from telemetry.page import page_measurement_unittest_base | 9 from telemetry.page import page_measurement_unittest_base |
10 # pylint: disable=W0401,W0614 | 10 # pylint: disable=W0401,W0614 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 tab = FakeTab() | 63 tab = FakeTab() |
64 measurement = smoothness.Smoothness() | 64 measurement = smoothness.Smoothness() |
65 measurement.WillRunActions(test_page, tab) | 65 measurement.WillRunActions(test_page, tab) |
66 | 66 |
67 expected_category_filter = [ | 67 expected_category_filter = [ |
68 'DELAY(cc.BeginMainFrame;0.012000;static)', | 68 'DELAY(cc.BeginMainFrame;0.012000;static)', |
69 'DELAY(cc.DrawAndSwap;0.012000;alternating)', | 69 'DELAY(cc.DrawAndSwap;0.012000;alternating)', |
70 'DELAY(gpu.PresentingFrame;0.012000;static)', | 70 'DELAY(gpu.PresentingFrame;0.012000;static)', |
71 'benchmark', | 71 'benchmark' |
72 'webkit.console' | |
73 ] | 72 ] |
74 actual_category_filter = tab.browser.category_filter.split(',') | 73 actual_category_filter = tab.browser.category_filter.split(',') |
75 actual_category_filter.sort() | 74 actual_category_filter.sort() |
| 75 |
| 76 # FIXME: Put blink.console into the expected above and remove these two |
| 77 # remove entries when the blink.console change has rolled into chromium. |
| 78 actual_category_filter.remove('webkit.console') |
| 79 actual_category_filter.remove('blink.console') |
| 80 |
76 if expected_category_filter != actual_category_filter: | 81 if expected_category_filter != actual_category_filter: |
77 sys.stderr.write("Expected category filter: %s\n" % | 82 sys.stderr.write("Expected category filter: %s\n" % |
78 repr(expected_category_filter)) | 83 repr(expected_category_filter)) |
79 sys.stderr.write("Actual category filter filter: %s\n" % | 84 sys.stderr.write("Actual category filter filter: %s\n" % |
80 repr(actual_category_filter)) | 85 repr(actual_category_filter)) |
81 self.assertEquals(expected_category_filter, actual_category_filter) | 86 self.assertEquals(expected_category_filter, actual_category_filter) |
82 | 87 |
83 def setUp(self): | 88 def setUp(self): |
84 self._options = options_for_unittests.GetCopy() | 89 self._options = options_for_unittests.GetCopy() |
85 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF | 90 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 measurement = smoothness.Smoothness() | 125 measurement = smoothness.Smoothness() |
121 results = self.RunMeasurement(measurement, ps, options=self._options) | 126 results = self.RunMeasurement(measurement, ps, options=self._options) |
122 self.assertEquals(0, len(results.failures)) | 127 self.assertEquals(0, len(results.failures)) |
123 | 128 |
124 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') | 129 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') |
125 self.assertEquals(len(mostly_smooth), 1) | 130 self.assertEquals(len(mostly_smooth), 1) |
126 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) | 131 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) |
127 | 132 |
128 def testCleanUpTrace(self): | 133 def testCleanUpTrace(self): |
129 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) | 134 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) |
OLD | NEW |