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

Side by Side Diff: tools/telemetry/telemetry/tab_unittest.py

Issue 11819045: Skips testActivateTab on old browsers which don't support tab control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tools/telemetry/telemetry/tab.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 from telemetry import tab_test_case 4 from telemetry import tab_test_case
5 from telemetry import tab_crash_exception 5 from telemetry import tab_crash_exception
6 from telemetry import util 6 from telemetry import util
7 7
8 8
9 def _IsDocumentVisible(tab): 9 def _IsDocumentVisible(tab):
10 state = tab.runtime.Evaluate('document.webkitVisibilityState') 10 state = tab.runtime.Evaluate('document.webkitVisibilityState')
(...skipping 12 matching lines...) Expand all
23 23
24 def testTabBrowserIsRightBrowser(self): 24 def testTabBrowserIsRightBrowser(self):
25 self.assertEquals(self._tab.browser, self._browser) 25 self.assertEquals(self._tab.browser, self._browser)
26 26
27 def testRendererCrash(self): 27 def testRendererCrash(self):
28 self.assertRaises(tab_crash_exception.TabCrashException, 28 self.assertRaises(tab_crash_exception.TabCrashException,
29 lambda: self._tab.page.Navigate('chrome://crash', 29 lambda: self._tab.page.Navigate('chrome://crash',
30 timeout=5)) 30 timeout=5))
31 31
32 def testActivateTab(self): 32 def testActivateTab(self):
33 if not self._browser.supports_tab_control:
34 return
33 self.assertTrue(_IsDocumentVisible(self._tab)) 35 self.assertTrue(_IsDocumentVisible(self._tab))
34 new_tab = self._browser.tabs.New() 36 new_tab = self._browser.tabs.New()
35 util.WaitFor(lambda: _IsDocumentVisible(new_tab), timeout=5) 37 util.WaitFor(lambda: _IsDocumentVisible(new_tab), timeout=5)
36 self.assertFalse(_IsDocumentVisible(self._tab)) 38 self.assertFalse(_IsDocumentVisible(self._tab))
37 self._tab.Activate() 39 self._tab.Activate()
38 util.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5) 40 util.WaitFor(lambda: _IsDocumentVisible(self._tab), timeout=5)
39 self.assertFalse(_IsDocumentVisible(new_tab)) 41 self.assertFalse(_IsDocumentVisible(new_tab))
40 42
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/tab.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698