Index: chrome/browser/lifetime/browser_close_manager_browsertest.cc |
diff --git a/chrome/browser/lifetime/browser_close_manager_browsertest.cc b/chrome/browser/lifetime/browser_close_manager_browsertest.cc |
index 67db8a250c6044fa75830f65ccaf3b88571c5d6b..53bcbb9f4646695d867d26def7c541f5c88ccace 100644 |
--- a/chrome/browser/lifetime/browser_close_manager_browsertest.cc |
+++ b/chrome/browser/lifetime/browser_close_manager_browsertest.cc |
@@ -21,6 +21,8 @@ |
#include "chrome/browser/download/download_service.h" |
#include "chrome/browser/download/download_service_factory.h" |
#include "chrome/browser/lifetime/application_lifetime.h" |
+#include "chrome/browser/lifetime/keep_alive_types.h" |
+#include "chrome/browser/lifetime/scoped_keep_alive.h" |
#include "chrome/browser/net/url_request_mock_util.h" |
#include "chrome/browser/prefs/session_startup_pref.h" |
#include "chrome/browser/profiles/profile.h" |
@@ -969,11 +971,13 @@ class BrowserCloseManagerWithBackgroundModeBrowserTest |
IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
CloseAllBrowsersWithBackgroundMode) { |
EXPECT_FALSE(IsBackgroundModeSuspended()); |
+ scoped_ptr<ScopedKeepAlive> tmp_keep_alive; |
Profile* profile = browser()->profile(); |
{ |
RepeatedNotificationObserver close_observer( |
chrome::NOTIFICATION_BROWSER_CLOSED, 1); |
- chrome::IncrementKeepAliveCount(); |
+ tmp_keep_alive.reset(new ScopedKeepAlive(KeepAliveOrigin::PANEL_VIEW, |
+ KeepAliveRestartOption::DISABLED)); |
chrome::CloseAllBrowsers(); |
close_observer.Wait(); |
} |
@@ -985,7 +989,7 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
ui_test_utils::BrowserAddedObserver new_browser_observer; |
chrome::NewEmptyWindow(profile); |
new_browser_observer.WaitForSingleNewBrowser(); |
- chrome::DecrementKeepAliveCount(); |
+ tmp_keep_alive.reset(); |
EXPECT_FALSE(IsBackgroundModeSuspended()); |
RepeatedNotificationObserver close_observer( |
chrome::NOTIFICATION_BROWSER_CLOSED, 1); |
@@ -1020,7 +1024,8 @@ IN_PROC_BROWSER_TEST_P(BrowserCloseManagerWithBackgroundModeBrowserTest, |
RepeatedNotificationObserver close_observer( |
chrome::NOTIFICATION_BROWSER_CLOSED, 1); |
EXPECT_FALSE(IsBackgroundModeSuspended()); |
- chrome::IncrementKeepAliveCount(); |
+ ScopedKeepAlive tmp_keep_alive(KeepAliveOrigin::PANEL_VIEW, |
+ KeepAliveRestartOption::DISABLED); |
browser()->window()->Close(); |
close_observer.Wait(); |
EXPECT_FALSE(browser_shutdown::IsTryingToQuit()); |