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 "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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 class BrowserCloseManagerBrowserTest | 256 class BrowserCloseManagerBrowserTest |
257 : public InProcessBrowserTest, | 257 : public InProcessBrowserTest, |
258 public testing::WithParamInterface<bool> { | 258 public testing::WithParamInterface<bool> { |
259 protected: | 259 protected: |
260 void SetUpOnMainThread() override { | 260 void SetUpOnMainThread() override { |
261 InProcessBrowserTest::SetUpOnMainThread(); | 261 InProcessBrowserTest::SetUpOnMainThread(); |
262 SessionStartupPref::SetStartupPref( | 262 SessionStartupPref::SetStartupPref( |
263 browser()->profile(), SessionStartupPref(SessionStartupPref::LAST)); | 263 browser()->profile(), SessionStartupPref(SessionStartupPref::LAST)); |
264 browsers_.push_back(browser()); | 264 browsers_.push_back(browser()); |
265 content::BrowserThread::PostTask( | 265 content::BrowserThread::PostTask( |
266 content::BrowserThread::IO, | 266 content::BrowserThread::IO, FROM_HERE, |
267 FROM_HERE, | 267 base::BindOnce(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); |
268 base::Bind(&chrome_browser_net::SetUrlRequestMocksEnabled, true)); | |
269 } | 268 } |
270 | 269 |
271 void SetUpCommandLine(base::CommandLine* command_line) override { | 270 void SetUpCommandLine(base::CommandLine* command_line) override { |
272 if (GetParam()) | 271 if (GetParam()) |
273 command_line->AppendSwitch(switches::kEnableFastUnload); | 272 command_line->AppendSwitch(switches::kEnableFastUnload); |
274 #if defined(OS_CHROMEOS) | 273 #if defined(OS_CHROMEOS) |
275 command_line->AppendSwitch( | 274 command_line->AppendSwitch( |
276 chromeos::switches::kIgnoreUserProfileMappingForTests); | 275 chromeos::switches::kIgnoreUserProfileMappingForTests); |
277 #endif | 276 #endif |
278 } | 277 } |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 | 1277 |
1279 chrome::CloseAllBrowsers(); | 1278 chrome::CloseAllBrowsers(); |
1280 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); | 1279 EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |
1281 EXPECT_TRUE(BrowserList::GetInstance()->empty()); | 1280 EXPECT_TRUE(BrowserList::GetInstance()->empty()); |
1282 EXPECT_TRUE(IsBackgroundModeSuspended()); | 1281 EXPECT_TRUE(IsBackgroundModeSuspended()); |
1283 } | 1282 } |
1284 | 1283 |
1285 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, | 1284 INSTANTIATE_TEST_CASE_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
1286 BrowserCloseManagerWithBackgroundModeBrowserTest, | 1285 BrowserCloseManagerWithBackgroundModeBrowserTest, |
1287 testing::Bool()); | 1286 testing::Bool()); |
OLD | NEW |