diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 17:19:01 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 17:19:01 +0000 |
commit | 529f2aa9cf237f2fbd413282ad5c4389873feb89 (patch) | |
tree | 059fa21414369e60d0edeac5758c471b5c047b24 | |
parent | cfefb8611bb217d2e4d8af84640a91d501616e60 (diff) | |
download | chromium_src-529f2aa9cf237f2fbd413282ad5c4389873feb89.zip chromium_src-529f2aa9cf237f2fbd413282ad5c4389873feb89.tar.gz chromium_src-529f2aa9cf237f2fbd413282ad5c4389873feb89.tar.bz2 |
PyAuto test for download from incognito window
Review URL: http://codereview.chromium.org/3270010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58010 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/test/functional/downloads.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/test/functional/downloads.py b/chrome/test/functional/downloads.py index 49c5a29..5bccce2 100644 --- a/chrome/test/functional/downloads.py +++ b/chrome/test/functional/downloads.py @@ -113,6 +113,24 @@ class DownloadsTest(pyauto.PyUITest): self.assertTrue(os.path.exists(downloaded_pkg)) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg)) + def testZipInIncognito(self): + """Download and verify a zip in incognito window.""" + test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') + file_path = os.path.join(test_dir, 'a_zip_file.zip') + file_url = self.GetFileURLForPath(file_path) + downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), + 'a_zip_file.zip') + os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) + + self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) # open incognito window + # Downloads from incognito window do not figure in GetDownloadsInfo() + # since the download manager's list doesn't contain it. + # Using WaitUntil is the only resort. + self.NavigateToURL(file_url, 1, 0) + self.assertTrue(self.WaitUntil(lambda: os.path.exists(downloaded_pkg))) + self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg)) + self.assertTrue(self.IsDownloadShelfVisible(1)) + def testSaveDangerousFile(self): """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() |