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

Side by Side Diff: functional/popups.py

Issue 6748013: Modifying the test, popups.PopupsTest.testLaunchBlockedPopupInIncognito, to wait until popup is b... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 9 years, 9 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 file_url = self.GetFileURLForPath(os.path.join( 65 file_url = self.GetFileURLForPath(os.path.join(
66 self.DataDir(), 'popup_blocker', 'popup-window-open.html')) 66 self.DataDir(), 'popup_blocker', 'popup-window-open.html'))
67 self.NavigateToURL(file_url, 1, 0) 67 self.NavigateToURL(file_url, 1, 0)
68 self.assertEqual(1, len(self.GetBlockedPopupsInfo(tab_index=0, windex=1))) 68 # Wait until the popup is blocked
69 self.WaitUntil(lambda:
70 len(self.GetBlockedPopupsInfo(tab_index=0, windex=1)), expect_retval=1)
anantha 2011/03/28 18:41:30 Please do self.assertEqual check again after self.
sunandt 2011/03/28 18:56:47 Since WaitUntil returns either True or False, I'm
69 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1) 71 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1)
70 # Verify that no more popups are blocked 72 # Verify that no more popups are blocked
71 self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) 73 self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1))
72 # Verify that popup window was created 74 # Verify that popup window was created
73 self.assertEqual(3, self.GetBrowserWindowCount(), 75 self.assertEqual(3, self.GetBrowserWindowCount(),
74 msg='Popup could not be launched'); 76 msg='Popup could not be launched');
75 self.assertEqual('Popup Success!', self.GetActiveTabTitle(2)) 77 self.assertEqual('Popup Success!', self.GetActiveTabTitle(2))
76 78
77 79
78 if __name__ == '__main__': 80 if __name__ == '__main__':
79 pyauto_functional.Main() 81 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