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

Unified Diff: components/autofill/content/renderer/password_autofill_agent_unittest.cc

Issue 258473005: Add a unittest for PasswordAutofillAgent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 8 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: 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

Powered by Google App Engine
This is Rietveld 408576698