OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from chrome_remote_control import multi_page_benchmark_unittest_base | 4 from telemetry import multi_page_benchmark_unittest_base |
5 from perf_tools import first_paint_time_benchmark | 5 from perf_tools import first_paint_time_benchmark |
6 | 6 |
7 class FirstPaintTimeBenchmarkUnitTest( | 7 class FirstPaintTimeBenchmarkUnitTest( |
8 multi_page_benchmark_unittest_base.MultiPageBenchmarkUnitTestBase): | 8 multi_page_benchmark_unittest_base.MultiPageBenchmarkUnitTestBase): |
9 | 9 |
10 def testFirstPaintTimeMeasurement(self): | 10 def testFirstPaintTimeMeasurement(self): |
11 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html') | 11 ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html') |
12 | 12 |
13 benchmark = first_paint_time_benchmark.FirstPaintTimeBenchmark() | 13 benchmark = first_paint_time_benchmark.FirstPaintTimeBenchmark() |
14 all_results = self.RunBenchmark(benchmark, ps) | 14 all_results = self.RunBenchmark(benchmark, ps) |
15 | 15 |
16 self.assertEqual(0, len(all_results.page_failures)) | 16 self.assertEqual(0, len(all_results.page_failures)) |
17 self.assertEqual(1, len(all_results.page_results)) | 17 self.assertEqual(1, len(all_results.page_results)) |
18 | 18 |
19 results0 = all_results.page_results[0] | 19 results0 = all_results.page_results[0] |
20 if results0['first_paint'] == 'unsupported': | 20 if results0['first_paint'] == 'unsupported': |
21 # This test can't run on content_shell. | 21 # This test can't run on content_shell. |
22 return | 22 return |
23 self.assertTrue(results0['first_paint'] > 0) | 23 self.assertTrue(results0['first_paint'] > 0) |
OLD | NEW |