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

Unified Diff: chrome/browser/password_manager/password_manager_unittest.cc

Issue 18068017: Change RenderViewHostTestHarness to create BrowserContext after thread startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
Index: chrome/browser/password_manager/password_manager_unittest.cc
diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc
index 7cc44389684f55f9ff2e69806b1d4619d56ed0fc..240698ee21cbc098feceac585be0f7f7c1b6fa6b 100644
--- a/chrome/browser/password_manager/password_manager_unittest.cc
+++ b/chrome/browser/password_manager/password_manager_unittest.cc
@@ -49,12 +49,10 @@ ACTION_P(SaveToScopedPtr, scoped) {
class PasswordManagerTest : public ChromeRenderViewHostTestHarness {
protected:
virtual void SetUp() {
- testing_profile_ = new TestingProfile;
+ ChromeRenderViewHostTestHarness::SetUp();
store_ = static_cast<MockPasswordStore*>(
PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
- testing_profile_, MockPasswordStore::Build).get());
- browser_context_.reset(testing_profile_);
- ChromeRenderViewHostTestHarness::SetUp();
+ profile(), MockPasswordStore::Build).get());
EXPECT_CALL(delegate_, GetProfile()).WillRepeatedly(Return(profile()));
PasswordManager::CreateForWebContentsAndDelegate(
@@ -89,8 +87,6 @@ class PasswordManagerTest : public ChromeRenderViewHostTestHarness {
scoped_refptr<MockPasswordStore> store_;
MockPasswordManagerDelegate delegate_; // Owned by manager_.
-
- TestingProfile* testing_profile_;
};
MATCHER_P(FormMatches, form, "") {
@@ -395,7 +391,7 @@ TEST_F(PasswordManagerTest, SavingDependsOnManagerEnabledPreference) {
// Test that saving passwords depends on the password manager enabled
// preference.
TestingPrefServiceSyncable* prefService =
- testing_profile_->GetTestingPrefService();
+ profile()->GetTestingPrefService();
prefService->SetUserPref(prefs::kPasswordManagerEnabled,
Value::CreateBooleanValue(true));
EXPECT_TRUE(manager()->IsSavingEnabled());
@@ -411,7 +407,7 @@ TEST_F(PasswordManagerTest, FillPasswordsOnDisabledManager) {
PasswordForm* existing = new PasswordForm(MakeSimpleForm());
result.push_back(existing);
TestingPrefServiceSyncable* prefService =
- testing_profile_->GetTestingPrefService();
+ profile()->GetTestingPrefService();
prefService->SetUserPref(prefs::kPasswordManagerEnabled,
Value::CreateBooleanValue(false));
EXPECT_CALL(delegate_, FillPasswordForm(_));

Powered by Google App Engine
This is Rietveld 408576698