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

Unified Diff: chrome/browser/lifetime/browser_close_manager_browsertest.cc

Issue 1778873002: Replace Increment/DecrementKeepAliveCount by ScopedKeepAlives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KAObserver
Patch Set: replace the commented dcheck by a dlog Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/lifetime/application_lifetime_aura.cc ('k') | chrome/browser/lifetime/keep_alive_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « chrome/browser/lifetime/application_lifetime_aura.cc ('k') | chrome/browser/lifetime/keep_alive_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698