Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: chrome/browser/extensions/api/streams_private/streams_private_apitest.cc

Issue 2593183002: [downloads] Remove DownloadManager::RemoveAllDownloads. (Closed)
Patch Set: Fix SavePageBrowsertest Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698