| OLD | NEW |
| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "chrome/browser/background/background_mode_manager.h" | 9 #include "chrome/browser/background/background_mode_manager.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 base::Bind(&TestDownloadManagerDelegate::SetDangerous, callback); | 160 base::Bind(&TestDownloadManagerDelegate::SetDangerous, callback); |
| 161 return ChromeDownloadManagerDelegate::DetermineDownloadTarget( | 161 return ChromeDownloadManagerDelegate::DetermineDownloadTarget( |
| 162 item, dangerous_callback); | 162 item, dangerous_callback); |
| 163 } | 163 } |
| 164 | 164 |
| 165 static void SetDangerous( | 165 static void SetDangerous( |
| 166 const content::DownloadTargetCallback& callback, | 166 const content::DownloadTargetCallback& callback, |
| 167 const base::FilePath& target_path, | 167 const base::FilePath& target_path, |
| 168 content::DownloadItem::TargetDisposition disp, | 168 content::DownloadItem::TargetDisposition disp, |
| 169 content::DownloadDangerType danger_type, | 169 content::DownloadDangerType danger_type, |
| 170 const base::FilePath& intermediate_path) { | 170 const base::FilePath& intermediate_path, |
| 171 bool hide_file_extension) { |
| 171 callback.Run(target_path, | 172 callback.Run(target_path, |
| 172 disp, | 173 disp, |
| 173 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, | 174 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, |
| 174 intermediate_path); | 175 intermediate_path, |
| 176 false); |
| 175 } | 177 } |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 class FakeBackgroundModeManager : public BackgroundModeManager { | 180 class FakeBackgroundModeManager : public BackgroundModeManager { |
| 179 public: | 181 public: |
| 180 FakeBackgroundModeManager() | 182 FakeBackgroundModeManager() |
| 181 : BackgroundModeManager( | 183 : BackgroundModeManager( |
| 182 *base::CommandLine::ForCurrentProcess(), | 184 *base::CommandLine::ForCurrentProcess(), |
| 183 &g_browser_process->profile_manager()->GetProfileInfoCache()), | 185 &g_browser_process->profile_manager()->GetProfileInfoCache()), |
| 184 suspended_(false) {} | 186 suspended_(false) {} |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 | 1034 |
| 1033 chrome::CloseAllBrowsers(); | 1035 chrome::CloseAllBrowsers(); |
| 1034 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); | 1036 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |
| 1035 EXPECT_TRUE(chrome::BrowserIterator().done()); | 1037 EXPECT_TRUE(chrome::BrowserIterator().done()); |
| 1036 EXPECT_TRUE(IsBackgroundModeSuspended()); | 1038 EXPECT_TRUE(IsBackgroundModeSuspended()); |
| 1037 } | 1039 } |
| 1038 | 1040 |
| 1039 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, | 1041 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 1040 BrowserCloseManagerWithBackgroundModeBrowserTest, | 1042 BrowserCloseManagerWithBackgroundModeBrowserTest, |
| 1041 testing::Bool()); | 1043 testing::Bool()); |
| OLD | NEW |