OLD | NEW |
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 measurements import record_per_area | 5 from measurements import record_per_area |
6 from telemetry.core import wpr_modes | 6 from telemetry.core import wpr_modes |
| 7 from telemetry import decorators |
7 from telemetry.unittest_util import options_for_unittests | 8 from telemetry.unittest_util import options_for_unittests |
8 from telemetry.unittest_util import page_test_test_case | 9 from telemetry.unittest_util import page_test_test_case |
9 from telemetry.unittest_util import test | |
10 | 10 |
11 | 11 |
12 class RecordPerAreaUnitTest(page_test_test_case.PageTestTestCase): | 12 class RecordPerAreaUnitTest(page_test_test_case.PageTestTestCase): |
13 """Smoke test for record_per_area measurement | 13 """Smoke test for record_per_area measurement |
14 | 14 |
15 Runs record_per_area measurement on a simple page and verifies | 15 Runs record_per_area measurement on a simple page and verifies |
16 that all metrics were added to the results. The test is purely functional, | 16 that all metrics were added to the results. The test is purely functional, |
17 i.e. it only checks if the metrics are present and non-zero. | 17 i.e. it only checks if the metrics are present and non-zero. |
18 """ | 18 """ |
19 | 19 |
20 def setUp(self): | 20 def setUp(self): |
21 self._options = options_for_unittests.GetCopy() | 21 self._options = options_for_unittests.GetCopy() |
22 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF | 22 self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF |
23 | 23 |
24 @test.Disabled('android') | 24 @decorators.Disabled('android') |
25 def testRecordPerArea(self): | 25 def testRecordPerArea(self): |
26 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html') | 26 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html') |
27 measurement = record_per_area.RecordPerArea() | 27 measurement = record_per_area.RecordPerArea() |
28 results = self.RunMeasurement(measurement, ps, options=self._options) | 28 results = self.RunMeasurement(measurement, ps, options=self._options) |
29 self.assertEquals(0, len(results.failures)) | 29 self.assertEquals(0, len(results.failures)) |
OLD | NEW |