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

Unified Diff: components/password_manager/core/browser/password_autofill_manager_unittest.cc

Issue 2665313002: Add a counter for clicking on Form-Not-Secure warnings (Closed)
Patch Set: rebase fixup again Created 3 years, 11 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/password_manager/core/browser/password_autofill_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_autofill_manager_unittest.cc b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
index 713b83cd24bf89bc48060ee0d689bb016e0a4777..297c8b14b1b20a4df38c923a7c55f90e39c840e4 100644
--- a/components/password_manager/core/browser/password_autofill_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
@@ -10,6 +10,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
+#include "base/test/user_action_tester.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion_test_helpers.h"
#include "components/autofill/core/browser/test_autofill_client.h"
@@ -788,4 +789,19 @@ TEST_F(PasswordAutofillManagerTest, SecurePasswordFieldHttpWarningMessage) {
autofill::IS_PASSWORD_FIELD, element_bounds);
}
+// Test that a user action is logged when the user selects the Form-Not-Secure
+// warning to receive more information about the warning.
+TEST_F(PasswordAutofillManagerTest, FormNotSecureUserAction) {
+ std::unique_ptr<TestPasswordManagerClient> client(
+ new TestPasswordManagerClient);
+ std::unique_ptr<MockAutofillClient> autofill_client(new MockAutofillClient);
+ InitializePasswordAutofillManager(client.get(), autofill_client.get());
+ base::UserActionTester user_action_tester;
+ password_autofill_manager_->DidAcceptSuggestion(
+ test_username_, autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE,
+ 0);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "PasswordManager_ShowedHttpNotSecureExplanation"));
+}
+
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698