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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 disp, | 172 disp, |
173 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, | 173 content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL, |
174 intermediate_path); | 174 intermediate_path); |
175 } | 175 } |
176 }; | 176 }; |
177 | 177 |
178 class FakeBackgroundModeManager : public BackgroundModeManager { | 178 class FakeBackgroundModeManager : public BackgroundModeManager { |
179 public: | 179 public: |
180 FakeBackgroundModeManager() | 180 FakeBackgroundModeManager() |
181 : BackgroundModeManager( | 181 : BackgroundModeManager( |
182 CommandLine::ForCurrentProcess(), | 182 base::CommandLine::ForCurrentProcess(), |
183 &g_browser_process->profile_manager()->GetProfileInfoCache()), | 183 &g_browser_process->profile_manager()->GetProfileInfoCache()), |
184 suspended_(false) {} | 184 suspended_(false) {} |
185 | 185 |
186 void SuspendBackgroundMode() override { | 186 void SuspendBackgroundMode() override { |
187 BackgroundModeManager::SuspendBackgroundMode(); | 187 BackgroundModeManager::SuspendBackgroundMode(); |
188 suspended_ = true; | 188 suspended_ = true; |
189 } | 189 } |
190 | 190 |
191 void ResumeBackgroundMode() override { | 191 void ResumeBackgroundMode() override { |
192 BackgroundModeManager::ResumeBackgroundMode(); | 192 BackgroundModeManager::ResumeBackgroundMode(); |
(...skipping 20 matching lines...) Expand all Loading... |
213 InProcessBrowserTest::SetUpOnMainThread(); | 213 InProcessBrowserTest::SetUpOnMainThread(); |
214 SessionStartupPref::SetStartupPref( | 214 SessionStartupPref::SetStartupPref( |
215 browser()->profile(), SessionStartupPref(SessionStartupPref::LAST)); | 215 browser()->profile(), SessionStartupPref(SessionStartupPref::LAST)); |
216 browsers_.push_back(browser()); | 216 browsers_.push_back(browser()); |
217 content::BrowserThread::PostTask( | 217 content::BrowserThread::PostTask( |
218 content::BrowserThread::IO, | 218 content::BrowserThread::IO, |
219 FROM_HERE, | 219 FROM_HERE, |
220 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); | 220 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
221 } | 221 } |
222 | 222 |
223 void SetUpCommandLine(CommandLine* command_line) override { | 223 void SetUpCommandLine(base::CommandLine* command_line) override { |
224 if (GetParam()) | 224 if (GetParam()) |
225 command_line->AppendSwitch(switches::kEnableFastUnload); | 225 command_line->AppendSwitch(switches::kEnableFastUnload); |
226 #if defined(OS_CHROMEOS) | 226 #if defined(OS_CHROMEOS) |
227 command_line->AppendSwitch( | 227 command_line->AppendSwitch( |
228 chromeos::switches::kIgnoreUserProfileMappingForTests); | 228 chromeos::switches::kIgnoreUserProfileMappingForTests); |
229 #endif | 229 #endif |
230 } | 230 } |
231 | 231 |
232 void CreateStalledDownload(Browser* browser) { | 232 void CreateStalledDownload(Browser* browser) { |
233 content::DownloadTestObserverInProgress observer( | 233 content::DownloadTestObserverInProgress observer( |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 | 946 |
947 chrome::CloseAllBrowsers(); | 947 chrome::CloseAllBrowsers(); |
948 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); | 948 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |
949 EXPECT_TRUE(chrome::BrowserIterator().done()); | 949 EXPECT_TRUE(chrome::BrowserIterator().done()); |
950 EXPECT_TRUE(IsBackgroundModeSuspended()); | 950 EXPECT_TRUE(IsBackgroundModeSuspended()); |
951 } | 951 } |
952 | 952 |
953 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, | 953 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
954 BrowserCloseManagerWithBackgroundModeBrowserTest, | 954 BrowserCloseManagerWithBackgroundModeBrowserTest, |
955 testing::Bool()); | 955 testing::Bool()); |
OLD | NEW |