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

Side by Side Diff: tools/perf/contrib/cluster_telemetry/repaint_unittest.py

Issue 2876073003: Migrate cluster telemetry benchmarks to tools/perf/contrib/cluster_telemetry/ (Closed)
Patch Set: Remove BENCHMARKS_BLACK_LIST Created 3 years, 7 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 from contrib.cluster_telemetry import repaint_helpers
6
7
5 from telemetry import decorators 8 from telemetry import decorators
6 from telemetry.page import page as page_module 9 from telemetry.page import page as page_module
7 from telemetry.testing import options_for_unittests 10 from telemetry.testing import options_for_unittests
8 from telemetry.testing import page_test_test_case 11 from telemetry.testing import page_test_test_case
9 from telemetry.util import wpr_modes 12 from telemetry.util import wpr_modes
10 13
11 from measurements import smoothness 14 from measurements import smoothness
12 from page_sets import repaint_helpers
13 15
14 16
15 class TestRepaintPage(page_module.Page): 17 class TestRepaintPage(page_module.Page):
16 18
17 def __init__(self, page_set, base_dir): 19 def __init__(self, page_set, base_dir):
18 super(TestRepaintPage, self).__init__('file://blank.html', 20 super(TestRepaintPage, self).__init__('file://blank.html',
19 page_set, base_dir) 21 page_set, base_dir)
20 22
21 def RunPageInteractions(self, action_runner): 23 def RunPageInteractions(self, action_runner):
22 repaint_helpers.Repaint(action_runner) 24 repaint_helpers.Repaint(action_runner)
23 25
24 26
25 class RepaintUnitTest(page_test_test_case.PageTestTestCase): 27 class RepaintUnitTest(page_test_test_case.PageTestTestCase):
26 """Smoke test for repaint measurement 28 """Smoke test for repaint measurement
27 29
28 Runs repaint measurement on a simple page and verifies 30 Runs repaint measurement on a simple page and verifies
29 that all metrics were added to the results. The test is purely functional, 31 that all metrics were added to the results. The test is purely functional,
30 i.e. it only checks if the metrics are present and non-zero. 32 i.e. it only checks if the metrics are present and non-zero.
31 """ 33 """
32 34
33 def setUp(self): 35 def setUp(self):
34 self._options = options_for_unittests.GetCopy() 36 self._options = options_for_unittests.GetCopy()
35 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF 37 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
36 38
37 # Previously this test was disabled on chromeos, see crbug.com/483212. 39 # Previously this test was disabled on chromeos, see crbug.com/483212.
38 @decorators.Disabled("all") # crbug.com/715962 40 @decorators.Disabled("all") # crbug.com/715962
nednguyen 2017/05/12 20:17:03 Walter: this is the actual smoke coverage of repai
39 def testRepaint(self): 41 def testRepaint(self):
40 ps = self.CreateEmptyPageSet() 42 ps = self.CreateEmptyPageSet()
41 ps.AddStory(TestRepaintPage(ps, ps.base_dir)) 43 ps.AddStory(TestRepaintPage(ps, ps.base_dir))
42 measurement = smoothness.Repaint() 44 measurement = smoothness.Repaint()
43 results = self.RunMeasurement(measurement, ps, options=self._options) 45 results = self.RunMeasurement(measurement, ps, options=self._options)
44 self.assertEquals(0, len(results.failures)) 46 self.assertEquals(0, len(results.failures))
45 47
46 frame_times = results.FindAllPageSpecificValuesNamed('frame_times') 48 frame_times = results.FindAllPageSpecificValuesNamed('frame_times')
47 self.assertEquals(len(frame_times), 1) 49 self.assertEquals(len(frame_times), 1)
48 self.assertGreater(frame_times[0].GetRepresentativeNumber(), 0) 50 self.assertGreater(frame_times[0].GetRepresentativeNumber(), 0)
(...skipping 14 matching lines...) Expand all
63 65
64 # Make sure that we don't have extra timeline based metrics that are not 66 # Make sure that we don't have extra timeline based metrics that are not
65 # related to smoothness. 67 # related to smoothness.
66 mainthread_jank = results.FindAllPageSpecificValuesNamed( 68 mainthread_jank = results.FindAllPageSpecificValuesNamed(
67 'responsive-total_big_jank_thread_time') 69 'responsive-total_big_jank_thread_time')
68 self.assertEquals(len(mainthread_jank), 0) 70 self.assertEquals(len(mainthread_jank), 0)
69 71
70 @decorators.Disabled('android') 72 @decorators.Disabled('android')
71 def testCleanUpTrace(self): 73 def testCleanUpTrace(self):
72 self.TestTracingCleanedUp(smoothness.Repaint, self._options) 74 self.TestTracingCleanedUp(smoothness.Repaint, self._options)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698