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

Unified Diff: chrome/browser/password_manager/password_manager_metrics_util_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 5 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_metrics_util_unittest.cc
diff --git a/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc b/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d31b56cecb6b8f1ed0c1b0c7417948b54de66463
--- /dev/null
+++ b/chrome/browser/password_manager/password_manager_metrics_util_unittest.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
Ilya Sherman 2013/08/30 22:34:42 nit: 2013. Also, please omit the "(c)".
jdomingos 2013/09/02 09:58:45 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/password_manager/password_manager_metrics_util.h"
Ilya Sherman 2013/08/30 22:34:42 nit: Please include a blank line after this one.
jdomingos 2013/09/02 09:58:45 Done.
+#include "testing/gmock/include/gmock/gmock.h"
Ilya Sherman 2013/08/30 22:34:42 nit: This is not needed.
jdomingos 2013/09/02 09:58:45 Done.
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST_F(PasswordManagerTest, IsDomainNameMonitoredTest) {
Ilya Sherman 2013/08/30 22:34:42 nit: TEST, not TEST_F.
jdomingos 2013/09/02 09:58:45 Done.
+ std::string domain_name;
+
+ EXPECT_TRUE(password_manager_util::IsDomainNameMonitored(
+ "https://www.linkedin.com", &domain_name));
+ EXPECT_EQ(domain_name == "linkedin.com");
+ EXPECT_TRUE(password_manager_util::IsDomainNameMonitored(
+ "https://www.amazon.com", &domain_name));
+ EXPECT_EQ(domain_name == "amazon.com");
+ EXPECT_FALSE(password_manager_util::IsDomainNameMonitored(
+ "https://www.facebook.com", &domain_name));
+ EXPECT_EQ(domain_name == "");
+ EXPECT_TRUE(password_manager_util::IsDomainNameMonitored(
+ "wikipedia.org", &domain_name));
+ EXPECT_EQ(domain_name == "wikipedia.org");
+ EXPECT_FALSE(password_manager_util::IsDomainNameMonitored(
+ "thisisnotwikipedia.org", &domain_name));
+ EXPECT_EQ(domain_name == "");
Ilya Sherman 2013/08/30 22:34:42 Please update this test code so that it compiles w
jdomingos 2013/08/30 22:57:17 Hi Ilya, What should I change in order to make it
Ilya Sherman 2013/08/30 23:00:47 IsDomainNameMonitored() no longer returns a boolea
jdomingos 2013/08/30 23:04:54 Indeed it is obvious that it doesn't work now. Th
+}

Powered by Google App Engine
This is Rietveld 408576698