| 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 | 4 |
| 5 import sys | 5 import sys |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 from metrics import keychain_metric | |
| 9 from telemetry.core import browser_options | 8 from telemetry.core import browser_options |
| 10 from telemetry.results import page_test_results | 9 from telemetry.results import page_test_results |
| 11 from telemetry.unittest_util import simple_mock | 10 from telemetry.unittest_util import simple_mock |
| 12 from telemetry.user_story import user_story_runner | 11 from telemetry.user_story import user_story_runner |
| 13 | 12 |
| 14 from measurements import page_cycler | 13 from measurements import page_cycler |
| 14 from metrics import keychain_metric |
| 15 | 15 |
| 16 | 16 |
| 17 # Allow testing protected members in the unit test. | 17 # Allow testing protected members in the unit test. |
| 18 # pylint: disable=W0212 | 18 # pylint: disable=W0212 |
| 19 | 19 |
| 20 class MockMemoryMetric(object): | 20 class MockMemoryMetric(object): |
| 21 """Used instead of simple_mock.MockObject so that the precise order and | 21 """Used instead of simple_mock.MockObject so that the precise order and |
| 22 number of calls need not be specified.""" | 22 number of calls need not be specified.""" |
| 23 def __init__(self): | 23 def __init__(self): |
| 24 pass | 24 pass |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 # does an initial navigate to avoid paying for a cross-renderer navigation. | 252 # does an initial navigate to avoid paying for a cross-renderer navigation. |
| 253 cycler = self.SetUpCycler(setup_memory_module=True) | 253 cycler = self.SetUpCycler(setup_memory_module=True) |
| 254 pages = [FakePage('file://fakepage1.com'), FakePage('file://fakepage2.com')] | 254 pages = [FakePage('file://fakepage1.com'), FakePage('file://fakepage2.com')] |
| 255 tab = FakeTab() | 255 tab = FakeTab() |
| 256 | 256 |
| 257 self.assertEqual([], tab.navigated_urls) | 257 self.assertEqual([], tab.navigated_urls) |
| 258 for page in pages * 2: | 258 for page in pages * 2: |
| 259 cycler.WillNavigateToPage(page, tab) | 259 cycler.WillNavigateToPage(page, tab) |
| 260 self.assertEqual( | 260 self.assertEqual( |
| 261 ['http://fakeserver:99999/nonexistent.html'], tab.navigated_urls) | 261 ['http://fakeserver:99999/nonexistent.html'], tab.navigated_urls) |
| OLD | NEW |