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 import StringIO | 4 import StringIO |
5 import os | 5 import os |
6 import unittest | 6 import unittest |
7 | 7 |
8 from telemetry import block_page_benchmark_results | 8 from telemetry.page import block_page_benchmark_results |
9 from telemetry.page_set import PageSet | 9 from telemetry.page import page_set |
10 | 10 |
11 BlockPageBenchmarkResults = \ | 11 BlockPageBenchmarkResults = \ |
12 block_page_benchmark_results.BlockPageBenchmarkResults | 12 block_page_benchmark_results.BlockPageBenchmarkResults |
13 | 13 |
14 def _MakePageSet(): | 14 def _MakePageSet(): |
15 return PageSet.FromDict({ | 15 return page_set.PageSet.FromDict({ |
16 "description": "hello", | 16 "description": "hello", |
17 "archive_path": "foo.wpr", | 17 "archive_path": "foo.wpr", |
18 "pages": [ | 18 "pages": [ |
19 {"url": "http://www.foo.com/"}, | 19 {"url": "http://www.foo.com/"}, |
20 {"url": "http://www.bar.com/"} | 20 {"url": "http://www.bar.com/"} |
21 ] | 21 ] |
22 }, os.path.dirname(__file__)) | 22 }, os.path.dirname(__file__)) |
23 | 23 |
24 class NonPrintingBlockPageBenchmarkResults(BlockPageBenchmarkResults): | 24 class NonPrintingBlockPageBenchmarkResults(BlockPageBenchmarkResults): |
25 def __init__(self, *args): | 25 def __init__(self, *args): |
(...skipping 28 matching lines...) Expand all Loading... |
54 | 54 |
55 expected = [ | 55 expected = [ |
56 ['url', 'http://www.foo.com/'], | 56 ['url', 'http://www.foo.com/'], |
57 ['foo (seconds)', '3'], | 57 ['foo (seconds)', '3'], |
58 [''], | 58 [''], |
59 ['url', 'http://www.bar.com/'], | 59 ['url', 'http://www.bar.com/'], |
60 ['bar (seconds)', '4'], | 60 ['bar (seconds)', '4'], |
61 [''] | 61 [''] |
62 ] | 62 ] |
63 self.assertEquals(self.data, expected) | 63 self.assertEquals(self.data, expected) |
OLD | NEW |