diff options
author | alyssad@google.com <alyssad@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 17:21:43 +0000 |
---|---|---|
committer | alyssad@google.com <alyssad@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-30 17:21:43 +0000 |
commit | bdda69dea5bbb3422dc0aa3a9326f4c8eded5bac (patch) | |
tree | 09d8cf9aded7a5b9b4303e601109d6ed9fb57b08 /chrome/test | |
parent | cacd99f3f8aebc07e4c86dd19c90c66ff5dded17 (diff) | |
download | chromium_src-bdda69dea5bbb3422dc0aa3a9326f4c8eded5bac.zip chromium_src-bdda69dea5bbb3422dc0aa3a9326f4c8eded5bac.tar.gz chromium_src-bdda69dea5bbb3422dc0aa3a9326f4c8eded5bac.tar.bz2 |
New downloads test for pyauto
New pyauto functional test for declining dangerous downloads.
Review URL: http://codereview.chromium.org/3265002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/functional/downloads.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/test/functional/downloads.py b/chrome/test/functional/downloads.py index e70e6cd..49c5a29 100644 --- a/chrome/test/functional/downloads.py +++ b/chrome/test/functional/downloads.py @@ -113,8 +113,8 @@ class DownloadsTest(pyauto.PyUITest): self.assertTrue(os.path.exists(downloaded_pkg)) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg)) - def testDownloadDangerousFiles(self): - """Verify that we can download and save dangerous files.""" + def testSaveDangerousFile(self): + """Verify that we can download and save a dangerous file.""" file_path = self._GetDangerousDownload() file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), @@ -131,6 +131,21 @@ class DownloadsTest(pyauto.PyUITest): self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) + def testDeclineDangerousDownload(self): + """Verify that we can decline dangerous downloads""" + file_path = self._GetDangerousDownload() + file_url = self.GetFileURLForPath(file_path) + downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), + os.path.basename(file_path)) + os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) + + self.DownloadAndWaitForStart(file_url) + self.PerformActionOnDownload(self._GetDownloadId(), + 'decline_dangerous_download') + self.assertFalse(os.path.exists(downloaded_pkg)) + self.assertFalse(self.GetDownloadsInfo().Downloads()) + self.assertFalse(self.IsDownloadShelfVisible()) + def testRemoveDownload(self): """Verify that we can remove a download.""" test_dir = os.path.join(os.path.abspath(self.DataDir()), 'downloads') |