diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 20:24:44 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 20:24:44 +0000 |
commit | 0c110f03a6058400453ec791e019a217e79f85f8 (patch) | |
tree | 0ae6740fd0f96501916aabf28444e2fa77148943 /chrome | |
parent | 228db22dd5d3d8d52f92593487b75d1259b26f0a (diff) | |
download | chromium_src-0c110f03a6058400453ec791e019a217e79f85f8.zip chromium_src-0c110f03a6058400453ec791e019a217e79f85f8.tar.gz chromium_src-0c110f03a6058400453ec791e019a217e79f85f8.tar.bz2 |
Added pyauto tests to popups
Added functions
testPopupBlockerInIncognito
testLaunchBlockedPopupInIncognito
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/5356001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/test/functional/popups.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/test/functional/popups.py b/chrome/test/functional/popups.py index 84ae6c4..9c81239 100644 --- a/chrome/test/functional/popups.py +++ b/chrome/test/functional/popups.py @@ -50,6 +50,30 @@ class PopupsTest(pyauto.PyUITest): msg='Popup could not be launched'); self.assertEqual('Popup Success!', self.GetActiveTabTitle(1)) + def testPopupBlockerInIncognito(self): + """Verify popup blocking is enabled in incognito windows.""" + self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) + file_url = self.GetFileURLForPath(os.path.join( + self.DataDir(), 'popup_blocker', 'popup-blocked-to-post-blank.html')) + self.NavigateToURL(file_url, 1, 0) + blocked_popups = self.GetBlockedPopupsInfo(tab_index=0, windex=1) + self.assertEqual(1, len(blocked_popups), msg='Popup not blocked') + + def testLaunchBlockedPopupInIncognito(self): + """Verify that a blocked popup can be unblocked in incognito.""" + self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) + file_url = self.GetFileURLForPath(os.path.join( + self.DataDir(), 'popup_blocker', 'popup-blocked-to-post-blank.html')) + self.NavigateToURL(file_url, 1, 0) + self.assertEqual(1, len(self.GetBlockedPopupsInfo(tab_index=0, windex=1))) + self.UnblockAndLaunchBlockedPopup(0, tab_index=0, windex=1) + # Verify that no more popups are blocked + self.assertFalse(self.GetBlockedPopupsInfo(tab_index=0, windex=1)) + # Verify that popup window was created + self.assertEqual(3, self.GetBrowserWindowCount(), + msg='Popup could not be launched'); + self.assertEqual('Popup Success!', self.GetActiveTabTitle(2)) + if __name__ == '__main__': pyauto_functional.Main() |