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 from telemetry.unittest import options_for_unittests | 10 from telemetry.unittest import options_for_unittests |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 test_page = page.Page('http://dummy', None) | 54 test_page = page.Page('http://dummy', None) |
55 test_page.synthetic_delays = { | 55 test_page.synthetic_delays = { |
56 'cc.BeginMainFrame': { 'target_duration': 0.012 }, | 56 'cc.BeginMainFrame': { 'target_duration': 0.012 }, |
57 'cc.DrawAndSwap': { 'target_duration': 0.012, 'mode': 'alternating' }, | 57 'cc.DrawAndSwap': { 'target_duration': 0.012, 'mode': 'alternating' }, |
58 'gpu.PresentingFrame': { 'target_duration': 0.012 } | 58 'gpu.PresentingFrame': { 'target_duration': 0.012 } |
59 } | 59 } |
60 | 60 |
61 tab = FakeTab() | 61 tab = FakeTab() |
62 measurement = smoothness.Smoothness() | 62 measurement = smoothness.Smoothness() |
63 measurement.WillStartBrowser(tab.browser) | 63 measurement.WillStartBrowser(tab.browser) |
64 measurement.WillRunActions(test_page, tab) | 64 measurement.WillNavigateToPage(test_page, tab) |
picksi
2014/07/18 11:30:58
Are we just moving this problem to somewhere else
Dominik Grewe
2014/07/18 16:10:51
How about we call both? :) That's what's happening
picksi
2014/07/18 16:47:20
Can it safely be doubly initialized without losing
| |
65 | 65 |
66 expected_category_filter = [ | 66 expected_category_filter = [ |
67 'DELAY(cc.BeginMainFrame;0.012000;static)', | 67 'DELAY(cc.BeginMainFrame;0.012000;static)', |
68 'DELAY(cc.DrawAndSwap;0.012000;alternating)', | 68 'DELAY(cc.DrawAndSwap;0.012000;alternating)', |
69 'DELAY(gpu.PresentingFrame;0.012000;static)', | 69 'DELAY(gpu.PresentingFrame;0.012000;static)', |
70 'benchmark' | 70 'benchmark' |
71 ] | 71 ] |
72 actual_category_filter = tab.browser.category_filter.split(',') | 72 actual_category_filter = tab.browser.category_filter.split(',') |
73 actual_category_filter.sort() | 73 actual_category_filter.sort() |
74 | 74 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 measurement = smoothness.Smoothness() | 124 measurement = smoothness.Smoothness() |
125 results = self.RunMeasurement(measurement, ps, options=self._options) | 125 results = self.RunMeasurement(measurement, ps, options=self._options) |
126 self.assertEquals(0, len(results.failures)) | 126 self.assertEquals(0, len(results.failures)) |
127 | 127 |
128 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') | 128 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') |
129 self.assertEquals(len(mostly_smooth), 1) | 129 self.assertEquals(len(mostly_smooth), 1) |
130 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) | 130 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) |
131 | 131 |
132 def testCleanUpTrace(self): | 132 def testCleanUpTrace(self): |
133 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) | 133 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) |
OLD | NEW |