#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/password_manager/password_generation_manager.h"
#include "chrome/browser/password_manager/password_manager.h"
-#include "chrome/browser/password_manager/password_manager_delegate_impl.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/pref_names.h"
class TestPasswordGenerationManager : public PasswordGenerationManager {
public:
explicit TestPasswordGenerationManager(content::WebContents* contents)
- : PasswordGenerationManager(contents) {}
+ : PasswordGenerationManager(
+ contents,
+ ChromePasswordManagerClient::FromWebContents(contents)) {}
virtual ~TestPasswordGenerationManager() {}
virtual void SendAccountCreationFormsToRenderer(
SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
ChromeRenderViewHostTestHarness::SetUp();
+ ChromePasswordManagerClient::CreateForWebContents(web_contents());
password_generation_manager_.reset(
new TestPasswordGenerationManager(web_contents()));
}
};
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.
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();
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.