+ EXPECT_CALL(logger_, LogSavePasswordProgress(kTestText)).Times(0);
+ client->LogSavePasswordProgress(kTestText);
+ EXPECT_FALSE(client->IsLoggingActive());
+}
+
+TEST_F(ChromePasswordManagerClientTest, LogSavePasswordProgressNotifyRenderer) {
+ ChromePasswordManagerClient* client = GetClient();
+ bool logging_active = false;
+
+ // Initially, the logging should be off, so no IPC messages.
+ EXPECT_FALSE(WasLoggingActivationMessageSent(&logging_active));
+
+ client->SetLogger(&logger_);
+ EXPECT_TRUE(WasLoggingActivationMessageSent(&logging_active));
+ EXPECT_TRUE(logging_active);
+
+ client->SetLogger(NULL);
+ EXPECT_TRUE(WasLoggingActivationMessageSent(&logging_active));
+ EXPECT_FALSE(logging_active);
+}
+
+TEST_F(ChromePasswordManagerClientTest,
+ IsAutomaticPasswordSavingEnabledDefaultBehaviourTest) {
+ EXPECT_FALSE(GetClient()->IsAutomaticPasswordSavingEnabled());
+}
+
+TEST_F(ChromePasswordManagerClientTest,
+ IsAutomaticPasswordSavingEnabledWhenFlagIsSetTest) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ password_manager::switches::kEnableAutomaticPasswordSaving);
+ if (chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN)
+ EXPECT_TRUE(GetClient()->IsAutomaticPasswordSavingEnabled());
+ else
+ EXPECT_FALSE(GetClient()->IsAutomaticPasswordSavingEnabled());