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

Unified Diff: popups.py

Issue 7043026: Added 3 more functions in popups.py (Closed) Base URL: http://src.chromium.org/svn/trunk/src/chrome/test/functional/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « omnibox.py ('k') | test_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: popups.py
===================================================================
--- popups.py (revision 86159)
+++ popups.py (working copy)
@@ -8,8 +8,8 @@
import pyauto_functional # Must be imported before pyauto
import pyauto
+import test_utils
-
class PopupsTest(pyauto.PyUITest):
"""TestCase for Popup blocking."""
@@ -141,6 +141,38 @@
self.assertEqual(5, self.GetBrowserWindowCount(),
msg='Last popup did not launch when the tab is closed.')
+ def testUnblockedPopupShowsInHistory(self):
+ """Verify that when you unblock popup, the popup shows in history."""
+ file_url = self.GetFileURLForDataPath('popup_blocker',
+ 'popup-window-open.html')
+ self.NavigateToURL(file_url)
+ self.assertEqual(1, len(self.GetBlockedPopupsInfo()))
+ self.UnblockAndLaunchBlockedPopup(0)
+ history = self.GetHistoryInfo().History()
+ self.assertEqual(2, len(history))
+ self.assertEqual('Popup Success!', history[0]['title'])
+ def testBlockedPopupNotShowInHistory(self):
+ """Verify that a blocked popup does not show up in history."""
+ file_url = self.GetFileURLForDataPath('popup_blocker',
+ 'popup-window-open.html')
+ self.NavigateToURL(file_url)
+ self.assertEqual(1, len(self.GetBlockedPopupsInfo()))
+ self.assertEqual(1, len(self.GetHistoryInfo().History()))
+
+ def testUnblockedPopupAddedToOmnibox(self):
+ """Verify that an unblocked popup shows up in omnibox suggestions."""
+ file_url = self.GetFileURLForDataPath('popup_blocker',
+ 'popup-window-open.html')
+ self.NavigateToURL(file_url)
+ self.assertEqual(1, len(self.GetBlockedPopupsInfo()))
+ self.UnblockAndLaunchBlockedPopup(0)
+ search_string = 'data:text/html,<title>Popup Success!</title> \
+ you should not see this message if popup blocker is enabled'
+ matches = test_utils.GetOmniboxMatchesFor(self, search_string)
+ self.assertEqual(search_string, matches[0]['destination_url'])
+ self.assertEqual(search_string, matches[0]['contents'])
+
+
if __name__ == '__main__':
pyauto_functional.Main()
« no previous file with comments | « omnibox.py ('k') | test_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698