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

Side by Side Diff: chrome/browser/lifetime/browser_close_manager_browsertest.cc

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)
Patch Set: . Created 3 years, 8 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/lifetime/browser_close_manager.h" 5 #include "chrome/browser/lifetime/browser_close_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 bool DetermineDownloadTarget( 205 bool DetermineDownloadTarget(
206 content::DownloadItem* item, 206 content::DownloadItem* item,
207 const content::DownloadTargetCallback& callback) override { 207 const content::DownloadTargetCallback& callback) override {
208 content::DownloadTargetCallback dangerous_callback = 208 content::DownloadTargetCallback dangerous_callback =
209 base::Bind(&TestDownloadManagerDelegate::SetDangerous, callback); 209 base::Bind(&TestDownloadManagerDelegate::SetDangerous, callback);
210 return ChromeDownloadManagerDelegate::DetermineDownloadTarget( 210 return ChromeDownloadManagerDelegate::DetermineDownloadTarget(
211 item, dangerous_callback); 211 item, dangerous_callback);
212 } 212 }
213 213
214 static void SetDangerous( 214 static void SetDangerous(const content::DownloadTargetCallback& callback,
215 const content::DownloadTargetCallback& callback, 215 const base::FilePath& target_path,
216 const base::FilePath& target_path, 216 content::DownloadItem::TargetDisposition disp,
217 content::DownloadItem::TargetDisposition disp, 217 content::DownloadDangerType danger_type,
218 content::DownloadDangerType danger_type, 218 const base::FilePath& intermediate_path,
219 const base::FilePath& intermediate_path) { 219 content::DownloadInterruptReason interrupt_reason) {
220 callback.Run(target_path, 220 callback.Run(target_path, disp, content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL,
221 disp, 221 intermediate_path, interrupt_reason);
222 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL,
223 intermediate_path);
224 } 222 }
225 }; 223 };
226 224
227 class FakeBackgroundModeManager : public BackgroundModeManager { 225 class FakeBackgroundModeManager : public BackgroundModeManager {
228 public: 226 public:
229 FakeBackgroundModeManager() 227 FakeBackgroundModeManager()
230 : BackgroundModeManager(*base::CommandLine::ForCurrentProcess(), 228 : BackgroundModeManager(*base::CommandLine::ForCurrentProcess(),
231 &g_browser_process->profile_manager() 229 &g_browser_process->profile_manager()
232 ->GetProfileAttributesStorage()), 230 ->GetProfileAttributesStorage()),
233 suspended_(false) {} 231 suspended_(false) {}
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 1291
1294 chrome::CloseAllBrowsers(); 1292 chrome::CloseAllBrowsers();
1295 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); 1293 EXPECT_FALSE(browser_shutdown::IsTryingToQuit());
1296 EXPECT_TRUE(BrowserList::GetInstance()->empty()); 1294 EXPECT_TRUE(BrowserList::GetInstance()->empty());
1297 EXPECT_TRUE(IsBackgroundModeSuspended()); 1295 EXPECT_TRUE(IsBackgroundModeSuspended());
1298 } 1296 }
1299 1297
1300 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, 1298 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest,
1301 BrowserCloseManagerWithBackgroundModeBrowserTest, 1299 BrowserCloseManagerWithBackgroundModeBrowserTest,
1302 testing::Bool()); 1300 testing::Bool());
OLDNEW
« no previous file with comments | « chrome/browser/download/download_test_file_activity_observer.cc ('k') | chromecast/browser/cast_download_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698