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 os | 4 import os |
5 import tempfile | 5 import tempfile |
6 import unittest | 6 import unittest |
7 | 7 |
8 from telemetry import page_set | 8 from telemetry.page import page_set |
9 | 9 |
10 simple_archive_info = """ | 10 simple_archive_info = """ |
11 { | 11 { |
12 "archives": { | 12 "archives": { |
13 "data_01.wpr": ["http://www.foo.com/"], | 13 "data_01.wpr": ["http://www.foo.com/"], |
14 "data_02.wpr": ["http://www.bar.com/"] | 14 "data_02.wpr": ["http://www.bar.com/"] |
15 } | 15 } |
16 } | 16 } |
17 """ | 17 """ |
18 | 18 |
(...skipping 19 matching lines...) Expand all Loading... |
38 f2.flush() | 38 f2.flush() |
39 ps = page_set.PageSet.FromFile(f2.name) | 39 ps = page_set.PageSet.FromFile(f2.name) |
40 | 40 |
41 self.assertEquals('hello', ps.description) | 41 self.assertEquals('hello', ps.description) |
42 self.assertEquals(archive_data_file, ps.archive_data_file) | 42 self.assertEquals(archive_data_file, ps.archive_data_file) |
43 self.assertEquals(2, len(ps.pages)) | 43 self.assertEquals(2, len(ps.pages)) |
44 self.assertEquals('http://www.foo.com/', ps.pages[0].url) | 44 self.assertEquals('http://www.foo.com/', ps.pages[0].url) |
45 self.assertEquals('http://www.bar.com/', ps.pages[1].url) | 45 self.assertEquals('http://www.bar.com/', ps.pages[1].url) |
46 self.assertEquals('data_01.wpr', os.path.basename(ps.pages[0].archive_path)) | 46 self.assertEquals('data_01.wpr', os.path.basename(ps.pages[0].archive_path)) |
47 self.assertEquals('data_02.wpr', os.path.basename(ps.pages[1].archive_path)) | 47 self.assertEquals('data_02.wpr', os.path.basename(ps.pages[1].archive_path)) |
OLD | NEW |