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

Unified Diff: chrome/renderer/autofill/password_autofill_agent_browsertest.cc

Issue 336763002: Password internals page: notify renderer about logging state on client construction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 6 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/renderer/autofill/password_autofill_agent_browsertest.cc
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index 9ac9002190929156e4db950a2a15533c6989660b..6226172f9bfe9c7f6fde3ca3f3ac7113000bf41c 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -1299,7 +1299,7 @@ TEST_F(PasswordAutofillAgentTest, OnChangeLoggingState_NoMessage) {
// Test that logging can be turned on by a message.
TEST_F(PasswordAutofillAgentTest, OnChangeLoggingState_Activated) {
// Turn the logging on.
- AutofillMsg_ChangeLoggingState msg_activate(0, true);
+ AutofillMsg_SetLoggingState msg_activate(0, true);
// Up-cast to access OnMessageReceived, which is private in the agent.
EXPECT_TRUE(static_cast<IPC::Listener*>(password_autofill_)
->OnMessageReceived(msg_activate));
@@ -1314,11 +1314,11 @@ TEST_F(PasswordAutofillAgentTest, OnChangeLoggingState_Activated) {
// Test that logging can be turned off by a message.
TEST_F(PasswordAutofillAgentTest, OnChangeLoggingState_Deactivated) {
// Turn the logging on and then off.
- AutofillMsg_ChangeLoggingState msg_activate(0, /*active=*/true);
+ AutofillMsg_SetLoggingState msg_activate(0, /*active=*/true);
// Up-cast to access OnMessageReceived, which is private in the agent.
EXPECT_TRUE(static_cast<IPC::Listener*>(password_autofill_)
->OnMessageReceived(msg_activate));
- AutofillMsg_ChangeLoggingState msg_deactivate(0, /*active=*/false);
+ AutofillMsg_SetLoggingState msg_deactivate(0, /*active=*/false);
EXPECT_TRUE(static_cast<IPC::Listener*>(password_autofill_)
->OnMessageReceived(msg_deactivate));
@@ -1329,4 +1329,12 @@ TEST_F(PasswordAutofillAgentTest, OnChangeLoggingState_Deactivated) {
EXPECT_FALSE(message);
}
+// Test that the agent sends an IPC call to get the current activity state of
+// password saving logging soon after construction.
+TEST_F(PasswordAutofillAgentTest, SendsLoggingStateUpdatePingOnConstruction) {
+ const IPC::Message* message = render_thread_->sink().GetFirstMessageMatching(
+ AutofillHostMsg_PasswordAutofillAgentConstructed::ID);
+ EXPECT_TRUE(message);
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698