summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
authorbauerb <bauerb@chromium.org>2015-02-26 11:47:29 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-26 19:48:28 +0000
commit944361e0a8808cc0c82dcb0ef4e58440f5d1c0fa (patch)
tree4bc6cc7e5dcb7dcc1026640384f4913aa5e0ec45 /chrome/browser/app_controller_mac.mm
parentf802eb0d796cc06cb957267d2fb6c57625e25956 (diff)
downloadchromium_src-944361e0a8808cc0c82dcb0ef4e58440f5d1c0fa.zip
chromium_src-944361e0a8808cc0c82dcb0ef4e58440f5d1c0fa.tar.gz
chromium_src-944361e0a8808cc0c82dcb0ef4e58440f5d1c0fa.tar.bz2
Wait until a new profile has been created before deleting the active profile.
BUG=460859 Review URL: https://codereview.chromium.org/953453002 Cr-Commit-Position: refs/heads/master@{#318288}
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 01feef4..866f7c0 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -897,7 +897,9 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// already loaded a new one, so the pointer needs to be updated;
// otherwise we will try to start up a browser window with a pointer
// to the old profile.
- if (lastProfile_ && profilePath == lastProfile_->GetPath())
+ // In a browser test, the application is not brought to the front, so
+ // |lastProfile_| might be null.
+ if (!lastProfile_ || profilePath == lastProfile_->GetPath())
lastProfile_ = g_browser_process->profile_manager()->GetLastUsedProfile();
auto it = profileBookmarkMenuBridgeMap_.find(profilePath);