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
3 # found in the LICENSE file.
6 from telemetry.core import browser_finder
7 from telemetry.unittest import options_for_unittests
9 class TabTestCase(unittest.TestCase):
10 def __init__(self, *args):
11 self._extra_browser_args = []
12 super(TabTestCase, self).__init__(*args)
17 options = options_for_unittests.GetCopy()
19 self.CustomizeBrowserOptions(options)
21 if self._extra_browser_args:
22 options.AppendExtraBrowserArgs(self._extra_browser_args)
24 browser_to_create = browser_finder.FindBrowser(options)
25 if not browser_to_create:
26 raise Exception('No browser found, cannot continue test.')
28 self._browser = browser_to_create.Create()
30 self._tab = self._browser.tabs[0]
31 self._tab.Navigate('about:blank')
39 self._tab.Disconnect()
43 def CustomizeBrowserOptions(self, options):
44 """Override to add test-specific options to the BrowserOptions object"""