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

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

Issue 151413008: Move ownership of Password(Generation)Manager to ContentPasswordDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up unittests Created 6 years, 11 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_generation_manager_unittest.cc
diff --git a/chrome/browser/password_manager/password_generation_manager_unittest.cc b/chrome/browser/password_manager/password_generation_manager_unittest.cc
index beb589b51671aed02897e59fe48cfaf05955e4b2..a8993e807558389d512cd51f5af874bff43cdf6e 100644
--- a/chrome/browser/password_manager/password_generation_manager_unittest.cc
+++ b/chrome/browser/password_manager/password_generation_manager_unittest.cc
@@ -41,7 +41,9 @@ class TestAutofillMetrics : public autofill::AutofillMetrics {
class TestPasswordGenerationManager : public PasswordGenerationManager {
public:
explicit TestPasswordGenerationManager(content::WebContents* contents)
- : PasswordGenerationManager(contents) {}
+ : PasswordGenerationManager(
+ contents,
+ PasswordManagerDelegateImpl::FromWebContents(contents)) {}
virtual ~TestPasswordGenerationManager() {}
virtual void SendAccountCreationFormsToRenderer(
@@ -71,6 +73,7 @@ class PasswordGenerationManagerTest : public ChromeRenderViewHostTestHarness {
SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
ChromeRenderViewHostTestHarness::SetUp();
+ PasswordManagerDelegateImpl::CreateForWebContents(web_contents());
password_generation_manager_.reset(
new TestPasswordGenerationManager(web_contents()));
}
@@ -104,11 +107,6 @@ class IncognitoPasswordGenerationManagerTest :
};
TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) {
- PasswordManagerDelegateImpl::CreateForWebContents(web_contents());
- PasswordManager::CreateForWebContentsAndDelegate(
- web_contents(),
- PasswordManagerDelegateImpl::FromWebContents(web_contents()));
-
PrefService* prefs = profile()->GetPrefs();
// Enable syncing. Generation should be enabled.
@@ -135,11 +133,6 @@ TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) {
TEST_F(PasswordGenerationManagerTest, DetectAccountCreationForms) {
// Setup so that IsGenerationEnabled() returns true.
- PasswordManagerDelegateImpl::CreateForWebContents(web_contents());
- PasswordManager::CreateForWebContentsAndDelegate(
- web_contents(),
- PasswordManagerDelegateImpl::FromWebContents(web_contents()));
-
ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetForProfile(
profile());
sync_service->SetSyncSetupCompleted();
@@ -197,11 +190,6 @@ TEST_F(IncognitoPasswordGenerationManagerTest,
UpdatePasswordSyncStateIncognito) {
// Disable password manager by going incognito. Even though syncing is
// enabled, generation should still be disabled.
- PasswordManagerDelegateImpl::CreateForWebContents(web_contents());
- PasswordManager::CreateForWebContentsAndDelegate(
- web_contents(),
- PasswordManagerDelegateImpl::FromWebContents(web_contents()));
-
PrefService* prefs = profile()->GetPrefs();
// Allow this test to control what should get synced.

Powered by Google App Engine
This is Rietveld 408576698