Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: tools/perf/measurements/smoothness_unittest.py

Issue 342993002: Allow blink.console or webkit.console in telemetry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 actual_category_filter.remove('webkit.console');
77 actual_category_filter.remove('blink.console');
78
76 if expected_category_filter != actual_category_filter: 79 if expected_category_filter != actual_category_filter:
77 sys.stderr.write("Expected category filter: %s\n" % 80 sys.stderr.write("Expected category filter: %s\n" %
78 repr(expected_category_filter)) 81 repr(expected_category_filter))
79 sys.stderr.write("Actual category filter filter: %s\n" % 82 sys.stderr.write("Actual category filter filter: %s\n" %
80 repr(actual_category_filter)) 83 repr(actual_category_filter))
81 self.assertEquals(expected_category_filter, actual_category_filter) 84 self.assertEquals(expected_category_filter, actual_category_filter)
82 85
83 def setUp(self): 86 def setUp(self):
84 self._options = options_for_unittests.GetCopy() 87 self._options = options_for_unittests.GetCopy()
85 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF 88 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 measurement = smoothness.Smoothness() 123 measurement = smoothness.Smoothness()
121 results = self.RunMeasurement(measurement, ps, options=self._options) 124 results = self.RunMeasurement(measurement, ps, options=self._options)
122 self.assertEquals(0, len(results.failures)) 125 self.assertEquals(0, len(results.failures))
123 126
124 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth') 127 mostly_smooth = results.FindAllPageSpecificValuesNamed('mostly_smooth')
125 self.assertEquals(len(mostly_smooth), 1) 128 self.assertEquals(len(mostly_smooth), 1)
126 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0) 129 self.assertGreaterEqual(mostly_smooth[0].GetRepresentativeNumber(), 0)
127 130
128 def testCleanUpTrace(self): 131 def testCleanUpTrace(self):
129 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) 132 self.TestTracingCleanedUp(smoothness.Smoothness, self._options)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698