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 unittest | 4 import unittest |
5 | 5 |
6 from telemetry import browser_finder | 6 from telemetry.core import browser_finder |
7 from telemetry import options_for_unittests | 7 from telemetry.test import options_for_unittests |
8 | 8 |
9 class BrowserTest(unittest.TestCase): | 9 class BrowserTest(unittest.TestCase): |
10 def testBrowserCreation(self): | 10 def testBrowserCreation(self): |
11 options = options_for_unittests.GetCopy() | 11 options = options_for_unittests.GetCopy() |
12 browser_to_create = browser_finder.FindBrowser(options) | 12 browser_to_create = browser_finder.FindBrowser(options) |
13 if not browser_to_create: | 13 if not browser_to_create: |
14 raise Exception('No browser found, cannot continue test.') | 14 raise Exception('No browser found, cannot continue test.') |
15 with browser_to_create.Create() as b: | 15 with browser_to_create.Create() as b: |
16 self.assertEquals(1, len(b.tabs)) | 16 self.assertEquals(1, len(b.tabs)) |
17 | 17 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 def testCloseReferencedTab(self): | 79 def testCloseReferencedTab(self): |
80 options = options_for_unittests.GetCopy() | 80 options = options_for_unittests.GetCopy() |
81 browser_to_create = browser_finder.FindBrowser(options) | 81 browser_to_create = browser_finder.FindBrowser(options) |
82 with browser_to_create.Create() as b: | 82 with browser_to_create.Create() as b: |
83 b.tabs.New() | 83 b.tabs.New() |
84 tab = b.tabs[0] | 84 tab = b.tabs[0] |
85 tab.Navigate('http://www.google.com/') | 85 tab.Navigate('http://www.google.com/') |
86 tab.Close() | 86 tab.Close() |
87 self.assertEquals(1, len(b.tabs)) | 87 self.assertEquals(1, len(b.tabs)) |
OLD | NEW |