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

Unified Diff: chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc

Issue 694593002: Profile unlock should always use session restore, regardless of system preference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a profile manager instance to the unit test Created 6 years, 1 month 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 | « no previous file | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
diff --git a/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc b/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
index ded91fb19a22e070164a0f5c69a96290e0c4412d..d3d9c4d26ae1c01a35ca69cb102ee8b7363eca87 100644
--- a/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
+++ b/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
@@ -4,11 +4,13 @@
#include "chrome/browser/ui/startup/session_crashed_infobar_delegate.h"
+#include "base/files/scoped_temp_dir.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/testing_pref_service.h"
#include "base/run_loop.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/prefs/browser_prefs.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h"
@@ -27,15 +29,23 @@ class SessionCrashedInfoBarDelegateUnitTest : public BrowserWithTestWindowTest {
// This needs to be called after the local state is set, because it will
// create a browser which will try to read from the local state.
BrowserWithTestWindowTest::SetUp();
+
+ // Make sure we have a Profile Manager.
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ TestingBrowserProcess::GetGlobal()->SetProfileManager(
+ new ProfileManagerWithoutInit(temp_dir_.path()));
}
void TearDown() override {
static_cast<TestingBrowserProcess*>(g_browser_process)->SetLocalState(NULL);
BrowserWithTestWindowTest::TearDown();
+
+ TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
}
private:
TestingPrefServiceSimple pref_service;
+ base::ScopedTempDir temp_dir_;
};
TEST_F(SessionCrashedInfoBarDelegateUnitTest, DetachingTabWithCrashedInfoBar) {
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698