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

Side by Side Diff: tools/perf/measurements/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
(Empty)
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
3 # found in the LICENSE file.
4
5 from telemetry import decorators
6 from telemetry.page import page as page_module
7 from telemetry.testing import options_for_unittests
8 from telemetry.testing import page_test_test_case
9 from telemetry.util import wpr_modes
10
11 from measurements import smoothness
12 from page_sets import repaint_helpers
13
14
15 class TestRepaintPage(page_module.Page):
16
17 def __init__(self, page_set, base_dir):
18 super(TestRepaintPage, self).__init__('file://blank.html',
19 page_set, base_dir)
20
21 def RunPageInteractions(self, action_runner):
22 repaint_helpers.Repaint(action_runner)
23
24
25 class RepaintUnitTest(page_test_test_case.PageTestTestCase):
26 """Smoke test for repaint measurement
27
28 Runs repaint measurement on a simple page and verifies
29 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.
31 """
32
33 def setUp(self):
34 self._options = options_for_unittests.GetCopy()
35 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
36
37 # Previously this test was disabled on chromeos, see crbug.com/483212.
38 @decorators.Disabled("all") # crbug.com/715962
39 def testRepaint(self):
40 ps = self.CreateEmptyPageSet()
41 ps.AddStory(TestRepaintPage(ps, ps.base_dir))
42 measurement = smoothness.Repaint()
43 results = self.RunMeasurement(measurement, ps, options=self._options)
44 self.assertEquals(0, len(results.failures))
45
46 frame_times = results.FindAllPageSpecificValuesNamed('frame_times')
47 self.assertEquals(len(frame_times), 1)
48 self.assertGreater(frame_times[0].GetRepresentativeNumber(), 0)
49
50 mean_frame_time = results.FindAllPageSpecificValuesNamed('mean_frame_time')
51 self.assertEquals(len(mean_frame_time), 1)
52 self.assertGreater(mean_frame_time[0].GetRepresentativeNumber(), 0)
53
54 frame_time_discrepancy = results.FindAllPageSpecificValuesNamed(
55 'frame_time_discrepancy')
56 self.assertEquals(len(frame_time_discrepancy), 1)
57 self.assertGreater(frame_time_discrepancy[0].GetRepresentativeNumber(), 0)
58
59 percentage_smooth = results.FindAllPageSpecificValuesNamed(
60 'percentage_smooth')
61 self.assertEquals(len(percentage_smooth), 1)
62 self.assertGreaterEqual(percentage_smooth[0].GetRepresentativeNumber(), 0)
63
64 # Make sure that we don't have extra timeline based metrics that are not
65 # related to smoothness.
66 mainthread_jank = results.FindAllPageSpecificValuesNamed(
67 'responsive-total_big_jank_thread_time')
68 self.assertEquals(len(mainthread_jank), 0)
69
70 @decorators.Disabled('android')
71 def testCleanUpTrace(self):
72 self.TestTracingCleanedUp(smoothness.Repaint, self._options)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698