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

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

Issue 737403002: Revert of telemetry: Remove command line args from page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 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 4
5 import logging 5 import logging
6 6
7 from measurements import rasterize_and_record_micro 7 from measurements import rasterize_and_record_micro
8 from telemetry.core import wpr_modes 8 from telemetry.core import wpr_modes
9 from telemetry.page import page_test 9 from telemetry.page import page_test
10 from telemetry.unittest_util import options_for_unittests 10 from telemetry.unittest_util import options_for_unittests
11 from telemetry.unittest_util import page_test_test_case 11 from telemetry.unittest_util import page_test_test_case
12 from telemetry.unittest_util import test 12 from telemetry.unittest_util import test
13 13
14 14
15 class RasterizeAndRecordMicroUnitTest(page_test_test_case.PageTestTestCase): 15 class RasterizeAndRecordMicroUnitTest(page_test_test_case.PageTestTestCase):
16 """Smoke test for rasterize_and_record_micro measurement 16 """Smoke test for rasterize_and_record_micro measurement
17 17
18 Runs rasterize_and_record_micro measurement on a simple page and verifies 18 Runs rasterize_and_record_micro measurement on a simple page and verifies
19 that all metrics were added to the results. The test is purely functional, 19 that all metrics were added to the results. The test is purely functional,
20 i.e. it only checks if the metrics are present and non-zero. 20 i.e. it only checks if the metrics are present and non-zero.
21 """ 21 """
22 22
23 def setUp(self): 23 def setUp(self):
24 self._options = options_for_unittests.GetCopy() 24 self._options = options_for_unittests.GetCopy()
25 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF 25 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
26 self._options.rasterize_repeat = 1
27 self._options.record_repeat = 1
28 self._options.start_wait_time = 0.0
29 self._options.report_detailed_results = True
26 30
27 @test.Disabled('win', 'chromeos') 31 @test.Disabled('win', 'chromeos')
28 def testRasterizeAndRecordMicro(self): 32 def testRasterizeAndRecordMicro(self):
29 ps = self.CreatePageSetFromFileInUnittestDataDir('blank.html') 33 ps = self.CreatePageSetFromFileInUnittestDataDir('blank.html')
30 measurement = rasterize_and_record_micro.RasterizeAndRecordMicro( 34 measurement = rasterize_and_record_micro.RasterizeAndRecordMicro()
31 rasterize_repeat=1, record_repeat=1, start_wait_time=0.0,
32 report_detailed_results=True)
33 try: 35 try:
34 results = self.RunMeasurement(measurement, ps, options=self._options) 36 results = self.RunMeasurement(measurement, ps, options=self._options)
35 except page_test.TestNotSupportedOnPlatformFailure as failure: 37 except page_test.TestNotSupportedOnPlatformFailure as failure:
36 logging.warning(str(failure)) 38 logging.warning(str(failure))
37 return 39 return
38 self.assertEquals(0, len(results.failures)) 40 self.assertEquals(0, len(results.failures))
39 41
40 rasterize_time = results.FindAllPageSpecificValuesNamed('rasterize_time') 42 rasterize_time = results.FindAllPageSpecificValuesNamed('rasterize_time')
41 self.assertEquals(len(rasterize_time), 1) 43 self.assertEquals(len(rasterize_time), 1)
42 self.assertGreater(rasterize_time[0].GetRepresentativeNumber(), 0) 44 self.assertGreater(rasterize_time[0].GetRepresentativeNumber(), 0)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 self.assertEquals(len(total_picture_layers_with_no_content), 1) 84 self.assertEquals(len(total_picture_layers_with_no_content), 1)
83 self.assertGreater( 85 self.assertGreater(
84 total_picture_layers_with_no_content[0].GetRepresentativeNumber(), 0) 86 total_picture_layers_with_no_content[0].GetRepresentativeNumber(), 0)
85 87
86 total_picture_layers_off_screen = \ 88 total_picture_layers_off_screen = \
87 results.FindAllPageSpecificValuesNamed( 89 results.FindAllPageSpecificValuesNamed(
88 'total_picture_layers_off_screen') 90 'total_picture_layers_off_screen')
89 self.assertEquals(len(total_picture_layers_off_screen), 1) 91 self.assertEquals(len(total_picture_layers_off_screen), 1)
90 self.assertEqual( 92 self.assertEqual(
91 total_picture_layers_off_screen[0].GetRepresentativeNumber(), 0) 93 total_picture_layers_off_screen[0].GetRepresentativeNumber(), 0)
94
95
OLDNEW
« no previous file with comments | « tools/perf/measurements/rasterize_and_record_micro.py ('k') | tools/perf/measurements/record_per_area.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698