diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 10:24:37 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 10:24:37 +0000 |
commit | 6e3953dd1dd86347917a18afc83f8c7d1792cd25 (patch) | |
tree | 5597083e7a38ca0a3ea5cd1a61374f9746d96973 /chrome/test | |
parent | d5c76964829a028d352ffbef642ae96303e98de6 (diff) | |
download | chromium_src-6e3953dd1dd86347917a18afc83f8c7d1792cd25.zip chromium_src-6e3953dd1dd86347917a18afc83f8c7d1792cd25.tar.gz chromium_src-6e3953dd1dd86347917a18afc83f8c7d1792cd25.tar.bz2 |
Send user gesture on reload. Add regression test.
Also, update pyauto test infobars.InfobarTest.testMultipleDownloadsInfobar to not use
GetTab(0).Reload() as this now is treated as a user gesture, which causes the DownloadRequestLimiter to reset its state.
BUG=110707
Initial commit: http://src.chromium.org/viewvc/chrome?view=rev&revision=118859
Revert (pyauto test broke): r118901
Review URL: https://chromiumcodereview.appspot.com/9269010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/data/downloads/download-a_zip_file.html | 6 | ||||
-rw-r--r-- | chrome/test/data/downloads/download-a_zip_file_frame.html | 11 | ||||
-rwxr-xr-x | chrome/test/functional/infobars.py | 11 |
3 files changed, 21 insertions, 7 deletions
diff --git a/chrome/test/data/downloads/download-a_zip_file.html b/chrome/test/data/downloads/download-a_zip_file.html index aec5516..3a7fe63 100644 --- a/chrome/test/data/downloads/download-a_zip_file.html +++ b/chrome/test/data/downloads/download-a_zip_file.html @@ -1,10 +1,12 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Test Download Multiple files Infobar.</title> -<script>window.location.href = "a_zip_file.zip";</script> </head> <body> -<h2>Reloading this page should trigger the multiple downloads infobar.</h2> +<h2>Loading this page should trigger the multiple downloads infobar.</h2> + +<iframe src="download-a_zip_file_frame.html"></iframe> +<iframe src="download-a_zip_file_frame.html"></iframe> </body> </html> diff --git a/chrome/test/data/downloads/download-a_zip_file_frame.html b/chrome/test/data/downloads/download-a_zip_file_frame.html new file mode 100644 index 0000000..425018f --- /dev/null +++ b/chrome/test/data/downloads/download-a_zip_file_frame.html @@ -0,0 +1,11 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Test Download Multiple files Infobar - Frame.</title>
+<script>window.location.href = "a_zip_file.zip";</script>
+</head>
+
+<body>
+<h2>This frame downloads a_zip_file.zip once.</h2>
+
+</body>
+</html>
+
diff --git a/chrome/test/functional/infobars.py b/chrome/test/functional/infobars.py index de50f91..8d97f93 100755 --- a/chrome/test/functional/infobars.py +++ b/chrome/test/functional/infobars.py @@ -124,17 +124,17 @@ class InfobarTest(pyauto.PyUITest): def testMultipleDownloadsInfobar(self): """Verify the mutiple downloads infobar.""" - zip_file = 'a_zip_file.zip' + zip_files = ['a_zip_file.zip'] + zip_files.append(zip_files[0].replace('.', ' (1).')) html_file = 'download-a_zip_file.html' assert pyauto.PyUITest.IsEnUS() file_url = self.GetFileURLForDataPath('downloads', html_file) match_text = 'This site is attempting to download multiple files. ' \ 'Do you want to allow this?' self.NavigateToURL('chrome://downloads') # trigger download manager - test_utils.RemoveDownloadedTestFile(self, zip_file) + for zip_file in zip_files: + test_utils.RemoveDownloadedTestFile(self, zip_file) self.DownloadAndWaitForStart(file_url) - # trigger page reload, which triggers the download infobar - self.GetBrowserWindow(0).GetTab(0).Reload() self.assertTrue(self.WaitForInfobarCount(1)) tab_info = self._GetTabInfo(0, 0) infobars = tab_info['infobars'] @@ -145,7 +145,8 @@ class InfobarTest(pyauto.PyUITest): self.assertEqual('Allow', infobars[0]['buttons'][0]) self.assertEqual('Deny', infobars[0]['buttons'][1]) self.WaitForAllDownloadsToComplete() - test_utils.RemoveDownloadedTestFile(self, zip_file) + for zip_file in zip_files: + test_utils.RemoveDownloadedTestFile(self, zip_file) def testPluginCrashForMultiTabs(self): """Verify plugin crash infobar shows up only on the tabs using plugin.""" |