Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: tools/telemetry/telemetry/unittest/tab_test_case.py

Issue 151003003: Fix navigation to unittest files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert changes in memory_cache_http_unittest.py Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/telemetry/telemetry/unittest/navigate_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.core import browser_finder 6 from telemetry.core import browser_finder
7 from telemetry.unittest import navigate_test
7 from telemetry.unittest import options_for_unittests 8 from telemetry.unittest import options_for_unittests
8 9
9 class TabTestCase(unittest.TestCase): 10 class TabTestCase(unittest.TestCase):
10 def __init__(self, *args): 11 def __init__(self, *args):
11 self._extra_browser_args = [] 12 self._extra_browser_args = []
13 self.test_file_path = None
12 super(TabTestCase, self).__init__(*args) 14 super(TabTestCase, self).__init__(*args)
13 15
14 def setUp(self): 16 def setUp(self):
15 self._browser = None 17 self._browser = None
16 self._tab = None 18 self._tab = None
17 options = options_for_unittests.GetCopy() 19 options = options_for_unittests.GetCopy()
18 20
19 self.CustomizeBrowserOptions(options) 21 self.CustomizeBrowserOptions(options)
20 22
21 if self._extra_browser_args: 23 if self._extra_browser_args:
(...skipping 15 matching lines...) Expand all
37 39
38 def tearDown(self): 40 def tearDown(self):
39 if self._tab: 41 if self._tab:
40 self._tab.Disconnect() 42 self._tab.Disconnect()
41 if self._browser: 43 if self._browser:
42 self._browser.Close() 44 self._browser.Close()
43 45
44 def CustomizeBrowserOptions(self, options): 46 def CustomizeBrowserOptions(self, options):
45 """Override to add test-specific options to the BrowserOptions object""" 47 """Override to add test-specific options to the BrowserOptions object"""
46 pass 48 pass
49
50 def Navigate(self, filename, script_to_evaluate_on_commit=None):
51 """Navigates |tab| to |filename| in the unittest data directory.
52
53 Also sets up http server to point to the unittest data directory.
54 """
55 self.test_file_path = navigate_test.NavigateToTestFile(
56 self._tab, filename, script_to_evaluate_on_commit)
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/unittest/navigate_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698