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

Side by Side Diff: functional/popups.py

Issue 6774001: Adding some logging for the test, testLaunchBlockedPopupInIncognito, to figure out its flakiness. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 9 years, 8 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 | « no previous file | 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 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import os 7 import os
8 8
9 import pyauto_functional # Must be imported before pyauto 9 import pyauto_functional # Must be imported before pyauto
10 import pyauto 10 import pyauto
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) 55 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
56 file_url = self.GetFileURLForPath(os.path.join( 56 file_url = self.GetFileURLForPath(os.path.join(
57 self.DataDir(), 'popup_blocker', 'popup-window-open.html')) 57 self.DataDir(), 'popup_blocker', 'popup-window-open.html'))
58 self.NavigateToURL(file_url, 1, 0) 58 self.NavigateToURL(file_url, 1, 0)
59 blocked_popups = self.GetBlockedPopupsInfo(tab_index=0, windex=1) 59 blocked_popups = self.GetBlockedPopupsInfo(tab_index=0, windex=1)
60 self.assertEqual(1, len(blocked_popups), msg='Popup not blocked') 60 self.assertEqual(1, len(blocked_popups), msg='Popup not blocked')
61 61
62 def testLaunchBlockedPopupInIncognito(self): 62 def testLaunchBlockedPopupInIncognito(self):
63 """Verify that a blocked popup can be unblocked in incognito.""" 63 """Verify that a blocked popup can be unblocked in incognito."""
64 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) 64 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
65 self.assertTrue(2, self.GetBrowserWindowCount())
65 file_url = self.GetFileURLForPath(os.path.join( 66 file_url = self.GetFileURLForPath(os.path.join(
66 self.DataDir(), 'popup_blocker', 'popup-window-open.html')) 67 self.DataDir(), 'popup_blocker', 'popup-window-open.html'))
67 self.NavigateToURL(file_url, 1, 0) 68 self.NavigateToURL(file_url, 1, 0)
69 self.assertEquals('Popup created using window.open',
70 self.GetActiveTabTitle(window_index=1))
68 # Wait until the popup is blocked 71 # Wait until the popup is blocked
69 self.assertTrue(self.WaitUntil(lambda: 72 self.assertTrue(self.WaitUntil(lambda:
70 len(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) is 1), 73 len(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) is 1),
71 msg='Popup not blocked') 74 msg='Popup not blocked')
72 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1) 75 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1)
73 # Verify that no more popups are blocked 76 # Verify that no more popups are blocked
74 self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) 77 self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1))
75 # Verify that popup window was created 78 # Verify that popup window was created
76 self.assertEqual(3, self.GetBrowserWindowCount(), 79 self.assertEqual(3, self.GetBrowserWindowCount(),
77 msg='Popup could not be launched'); 80 msg='Popup could not be launched');
78 self.assertEqual('Popup Success!', self.GetActiveTabTitle(2)) 81 self.assertEqual('Popup Success!', self.GetActiveTabTitle(2))
79 82
80 83
81 if __name__ == '__main__': 84 if __name__ == '__main__':
82 pyauto_functional.Main() 85 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698