Index: chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc |
diff --git a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc |
index 1d9fa4fb59667a78dff2dd16216aaae1ff56b55b..5560387fefc109a8c40616e789d7333220bec697 100644 |
--- a/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc |
+++ b/chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.cc |
@@ -104,10 +104,10 @@ std::string QuitWithAppsController::id() const { |
bool QuitWithAppsController::ShouldQuit() { |
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
- if (!CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kAppsKeepChromeAlive)) { |
- g_browser_process->local_state()->ClearPref( |
- prefs::kNotifyWhenAppsKeepChromeAlive); |
+ // Quit immediately if this is a test. |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType) && |
+ !CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kAppsKeepChromeAliveInTests)) { |
return true; |
} |