Index: components/autofill/content/renderer/password_autofill_agent_unittest.cc |
diff --git a/components/autofill/content/renderer/password_autofill_agent_unittest.cc b/components/autofill/content/renderer/password_autofill_agent_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4dd9b515b93d895a3f047e707174b1c188797e97 |
--- /dev/null |
+++ b/components/autofill/content/renderer/password_autofill_agent_unittest.cc |
@@ -0,0 +1,26 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/autofill/content/common/autofill_messages.h" |
+#include "components/autofill/content/renderer/test_password_autofill_agent.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace autofill { |
+ |
+TEST(PasswordAutofillAgentTest, OnChangeLoggingState) { |
+ TestPasswordAutofillAgent agent(NULL); |
+ IPC::Listener* const agent_listener(&agent); |
+ |
+ EXPECT_FALSE(agent.logging_state_active()); |
+ |
+ AutofillMsg_ChangeLoggingState msg_activate(0, true); |
+ EXPECT_TRUE(agent_listener->OnMessageReceived(msg_activate)); |
+ EXPECT_TRUE(agent.logging_state_active()); |
+ |
+ AutofillMsg_ChangeLoggingState msg_deactivate(0, false); |
+ EXPECT_TRUE(agent_listener->OnMessageReceived(msg_deactivate)); |
+ EXPECT_FALSE(agent.logging_state_active()); |
+} |
+ |
+} // namespace autofill |