diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 19:14:55 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 19:14:55 +0000 |
commit | 366f7c65d427fb9eea581513d762a4b5b59ea3fa (patch) | |
tree | 4985d6e82c824df56a7049179c9b5540b85b0f41 /chrome/test/functional/infobars.py | |
parent | 211d0260056c82843c27945c25bfe3ed59abacc3 (diff) | |
download | chromium_src-366f7c65d427fb9eea581513d762a4b5b59ea3fa.zip chromium_src-366f7c65d427fb9eea581513d762a4b5b59ea3fa.tar.gz chromium_src-366f7c65d427fb9eea581513d762a4b5b59ea3fa.tar.bz2 |
Test to verify the 'multiple downloads' infobar
Verifies the multiple downloads infobar.
Implemented by Venkat, who figured out how to reliably trigger the multiple
downloads infobar.
Review URL: http://codereview.chromium.org/3066017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54163 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional/infobars.py')
-rw-r--r-- | chrome/test/functional/infobars.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/test/functional/infobars.py b/chrome/test/functional/infobars.py index a689dcc..ebf1656 100644 --- a/chrome/test/functional/infobars.py +++ b/chrome/test/functional/infobars.py @@ -108,6 +108,36 @@ class InfobarTest(pyauto.PyUITest): self.WaitForInfobarCount(1, windex=2, tab_index=0) self._VerifyGeolocationInfobar(windex=2, tab_index=0, match_text=match_text) + def testMultipleDownloadsInfobar(self): + """Verify the mutiple downloads infobar.""" + assert pyauto.PyUITest.IsEnUS() + file_url = self.GetFileURLForPath( + os.path.join(self.DataDir(), 'downloads', 'download-a_zip_file.html')) + match_text = 'This site is attempting to download multiple files. ' \ + 'Do you want to allow this?' + self.NavigateToURL('chrome://downloads') # trigger download manager + # Clear existing files of the same name in the downloads folder + downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), + 'a_zip_file.zip') + os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) + self.DownloadAndWaitForStart(file_url) + # trigger page reload, which triggers the download infobar + self.GetBrowserWindow(0).GetTab(0).Reload() + self.WaitForInfobarCount(1) + tab_info = self._GetTabInfo(0, 0) + infobars = tab_info['infobars'] + self.assertTrue(infobars, 'Expected the multiple downloads infobar') + self.assertEqual(1, len(infobars)) + self.assertEqual(match_text, infobars[0]['text']) + self.assertEqual(2, len(infobars[0]['buttons'])) + self.assertEqual('Allow', infobars[0]['buttons'][0]) + self.assertEqual('Deny', infobars[0]['buttons'][1]) + # Ensure we quit only after all downloads have completed + self.WaitForAllDownloadsToComplete() + downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), + 'a_zip_file.zip') + os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) + if __name__ == '__main__': pyauto_functional.Main() |