summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 17:19:01 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 17:19:01 +0000
commit529f2aa9cf237f2fbd413282ad5c4389873feb89 (patch)
tree059fa21414369e60d0edeac5758c471b5c047b24
parentcfefb8611bb217d2e4d8af84640a91d501616e60 (diff)
downloadchromium_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.py18
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()