OLD | NEW |
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 import os | 4 import os |
5 import unittest | 5 import unittest |
6 | 6 |
7 from telemetry import page as page_module | 7 from telemetry import page as page_module |
| 8 from telemetry.page import page_set |
8 from telemetry import value | 9 from telemetry import value |
9 from telemetry.page import page_set | |
10 from telemetry.value import histogram as histogram_module | 10 from telemetry.value import histogram as histogram_module |
11 | 11 |
12 | 12 |
13 class TestBase(unittest.TestCase): | 13 class TestBase(unittest.TestCase): |
14 def setUp(self): | 14 def setUp(self): |
15 ps = page_set.PageSet(file_path=os.path.dirname(__file__)) | 15 ps = page_set.PageSet(file_path=os.path.dirname(__file__)) |
16 ps.AddUserStory(page_module.Page("http://www.bar.com/", ps, ps.base_dir)) | 16 ps.AddUserStory(page_module.Page("http://www.bar.com/", ps, ps.base_dir)) |
17 ps.AddUserStory(page_module.Page("http://www.baz.com/", ps, ps.base_dir)) | 17 ps.AddUserStory(page_module.Page("http://www.baz.com/", ps, ps.base_dir)) |
18 ps.AddUserStory(page_module.Page("http://www.foo.com/", ps, ps.base_dir)) | 18 ps.AddUserStory(page_module.Page("http://www.foo.com/", ps, ps.base_dir)) |
19 self.page_set = ps | 19 self.page_set = ps |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 'name': 'x', | 73 'name': 'x', |
74 'units': 'counts', | 74 'units': 'counts', |
75 'buckets': [{'low': 1, 'high': 2, 'count': 1}] | 75 'buckets': [{'low': 1, 'high': 2, 'count': 1}] |
76 } | 76 } |
77 v = value.Value.FromDict(d, {}) | 77 v = value.Value.FromDict(d, {}) |
78 | 78 |
79 self.assertTrue(isinstance(v, histogram_module.HistogramValue)) | 79 self.assertTrue(isinstance(v, histogram_module.HistogramValue)) |
80 self.assertEquals( | 80 self.assertEquals( |
81 ['{"buckets": [{"low": 1, "high": 2, "count": 1}]}'], | 81 ['{"buckets": [{"low": 1, "high": 2, "count": 1}]}'], |
82 v.GetBuildbotValue()) | 82 v.GetBuildbotValue()) |
OLD | NEW |