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

Unified Diff: chrome/browser/password_manager/password_manager_unittest.cc

Issue 23140005: Added of new UMA signals in order to be able to discover early if the "save password" feature gets … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review 3 Created 7 years, 4 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/browser/password_manager/password_manager_unittest.cc
diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc
index cecba4f5465f19aead9804a1d70dde7cdc3adf46..80e28293488bb379502f18732b1e2e7e6e05f3ad 100644
--- a/chrome/browser/password_manager/password_manager_unittest.cc
+++ b/chrome/browser/password_manager/password_manager_unittest.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/password_manager/mock_password_store.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/password_manager/password_manager_delegate.h"
+#include "chrome/browser/password_manager/password_manager_util.h"
#include "chrome/browser/password_manager/password_store.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/common/pref_names.h"
@@ -536,3 +537,17 @@ TEST_F(PasswordManagerTest, SubmissionCallbackTest) {
OnPasswordFormSubmitted(form);
EXPECT_TRUE(FormsAreEqual(form, submitted_form_));
}
+
+TEST_F(PasswordManagerTest, IsDomainNameMonitoredTest) {
+ std::string domain_name;
+
+ EXPECT_TRUE(password_manager_util::IsDomainNameMonitored(
+ "https://www.linkedin.com", &domain_name));
+ ASSERT_TRUE(domain_name == "linkedin.com");
+ EXPECT_TRUE(password_manager_util::IsDomainNameMonitored(
+ "https://www.amazon.com", &domain_name));
+ ASSERT_TRUE(domain_name == "amazon.com");
+ EXPECT_FALSE(password_manager_util::IsDomainNameMonitored(
+ "https://www.facebook.com", &domain_name));
+ ASSERT_TRUE(domain_name == "");
vabr (Chromium) 2013/08/28 15:49:45 Please also add tests for bare domains ("yahoo.com
+}

Powered by Google App Engine
This is Rietveld 408576698