OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/download/download_prefs.h" | 10 #include "chrome/browser/download/download_prefs.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // Setup default downloads directory to the scoped tmp directory created for | 156 // Setup default downloads directory to the scoped tmp directory created for |
157 // the test. | 157 // the test. |
158 browser()->profile()->GetPrefs()->SetFilePath( | 158 browser()->profile()->GetPrefs()->SetFilePath( |
159 prefs::kDownloadDefaultDirectory, downloads_dir_.GetPath()); | 159 prefs::kDownloadDefaultDirectory, downloads_dir_.GetPath()); |
160 // Ensure there are no prompts for download during the test. | 160 // Ensure there are no prompts for download during the test. |
161 browser()->profile()->GetPrefs()->SetBoolean( | 161 browser()->profile()->GetPrefs()->SetBoolean( |
162 prefs::kPromptForDownload, false); | 162 prefs::kPromptForDownload, false); |
163 | 163 |
164 DownloadManager* manager = GetDownloadManager(); | 164 DownloadManager* manager = GetDownloadManager(); |
165 DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen(); | 165 DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen(); |
166 manager->RemoveAllDownloads(); | |
167 } | 166 } |
168 | 167 |
169 // Sends onExecuteContentHandler event with the MIME type "test/done" to the | 168 // Sends onExecuteContentHandler event with the MIME type "test/done" to the |
170 // test extension. | 169 // test extension. |
171 // The test extension calls 'chrome.test.notifySuccess' when it receives the | 170 // The test extension calls 'chrome.test.notifySuccess' when it receives the |
172 // event with the "test/done" MIME type (unless the 'chrome.test.notifyFail' | 171 // event with the "test/done" MIME type (unless the 'chrome.test.notifyFail' |
173 // has already been called). | 172 // has already been called). |
174 void SendDoneEvent() { | 173 void SendDoneEvent() { |
175 streams_private::StreamInfo info; | 174 streams_private::StreamInfo info; |
176 info.mime_type = "test/done"; | 175 info.mime_type = "test/done"; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 base::RunLoop().RunUntilIdle(); | 445 base::RunLoop().RunUntilIdle(); |
447 EXPECT_TRUE(catcher.GetNextResult()); | 446 EXPECT_TRUE(catcher.GetNextResult()); |
448 | 447 |
449 ui_test_utils::NavigateToURL(browser(), | 448 ui_test_utils::NavigateToURL(browser(), |
450 test_server_->GetURL("/abort.rtf")); | 449 test_server_->GetURL("/abort.rtf")); |
451 base::RunLoop().RunUntilIdle(); | 450 base::RunLoop().RunUntilIdle(); |
452 EXPECT_TRUE(catcher.GetNextResult()); | 451 EXPECT_TRUE(catcher.GetNextResult()); |
453 } | 452 } |
454 | 453 |
455 } // namespace | 454 } // namespace |
OLD | NEW |