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

Side by Side Diff: functional/popups.py

Issue 6735061: Correcting a TypeError in popups pyauto test. (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 import logging 8 import logging
9 9
10 import pyauto_functional # Must be imported before pyauto 10 import pyauto_functional # Must be imported before pyauto
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 self.assertTrue(2, self.GetBrowserWindowCount()) 66 self.assertTrue(2, self.GetBrowserWindowCount())
67 file_url = self.GetFileURLForPath(os.path.join( 67 file_url = self.GetFileURLForPath(os.path.join(
68 self.DataDir(), 'popup_blocker', 'popup-window-open.html')) 68 self.DataDir(), 'popup_blocker', 'popup-window-open.html'))
69 self.NavigateToURL(file_url, 1, 0) 69 self.NavigateToURL(file_url, 1, 0)
70 # TODO(sunandt): Work around for debugging the flakiness 70 # TODO(sunandt): Work around for debugging the flakiness
71 # Related to crbug.com/64274 71 # Related to crbug.com/64274
72 attempts = 0 72 attempts = 0
73 while attempts < 3: 73 while attempts < 3:
74 if self.GetActiveTabTitle(window_index=1) != \ 74 if self.GetActiveTabTitle(window_index=1) != \
75 'Popup created using window.open': 75 'Popup created using window.open':
76 logging.debug('Attempt %s' % attempts+1) 76 logging.debug('Attempt %d' % attempts+1)
Nirnimesh 2011/04/05 17:43:02 put space around +
sunandt 2011/04/05 17:45:24 Done.
77 self.NavigateToURL(file_url, 1, 0) 77 self.NavigateToURL(file_url, 1, 0)
78 attempts = attempts + 1 78 attempts = attempts + 1
79 else: 79 else:
80 break 80 break
81 self.assertEquals('Popup created using window.open', 81 self.assertEquals('Popup created using window.open',
82 self.GetActiveTabTitle(window_index=1)) 82 self.GetActiveTabTitle(window_index=1))
83 # Wait until the popup is blocked 83 # Wait until the popup is blocked
84 self.assertTrue(self.WaitUntil(lambda: 84 self.assertTrue(self.WaitUntil(lambda:
85 len(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) is 1), 85 len(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) is 1),
86 msg='Popup not blocked') 86 msg='Popup not blocked')
87 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1) 87 self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1)
88 # Verify that no more popups are blocked 88 # Verify that no more popups are blocked
89 self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) 89 self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1))
90 # Verify that popup window was created 90 # Verify that popup window was created
91 self.assertEqual(3, self.GetBrowserWindowCount(), 91 self.assertEqual(3, self.GetBrowserWindowCount(),
92 msg='Popup could not be launched'); 92 msg='Popup could not be launched');
93 self.assertEqual('Popup Success!', self.GetActiveTabTitle(2)) 93 self.assertEqual('Popup Success!', self.GetActiveTabTitle(2))
94 94
95 95
96 if __name__ == '__main__': 96 if __name__ == '__main__':
97 pyauto_functional.Main() 97 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