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

Unified Diff: chrome/browser/chromeos/login/authenticator_unittest.cc

Issue 6089004: [Chrome OS] Respect periods in google apps account names (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ws fix Created 10 years 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/chromeos/login/authenticator_unittest.cc
diff --git a/chrome/browser/chromeos/login/authenticator_unittest.cc b/chrome/browser/chromeos/login/authenticator_unittest.cc
index 48ab3785ccc87b123e0642fe8cd08e9a8c5d4327..3f82f160d89ac08f4c6e5d60c8e5e1a2ffc72540 100644
--- a/chrome/browser/chromeos/login/authenticator_unittest.cc
+++ b/chrome/browser/chromeos/login/authenticator_unittest.cc
@@ -23,19 +23,41 @@ TEST(AuthenticatorTest, EmailAddressIgnoreDomainCaps) {
Authenticator::Canonicalize("UsEr@what.COM"));
}
-TEST(AuthenticatorTest, EmailAddressIgnoreOneUsernameDot) {
- EXPECT_EQ(Authenticator::Canonicalize("us.er@what.com"),
+TEST(AuthenticatorTest, EmailAddressRejectOneUsernameDot) {
+ EXPECT_NE(Authenticator::Canonicalize("u.ser@what.com"),
Authenticator::Canonicalize("UsEr@what.com"));
}
-TEST(AuthenticatorTest, EmailAddressIgnoreManyUsernameDots) {
+TEST(AuthenticatorTest, EmailAddressMatchWithOneUsernameDot) {
EXPECT_EQ(Authenticator::Canonicalize("u.ser@what.com"),
- Authenticator::Canonicalize("Us.E.r@what.com"));
+ Authenticator::Canonicalize("U.sEr@what.com"));
+}
+
+TEST(AuthenticatorTest, EmailAddressIgnoreOneUsernameDot) {
+ std::string first("us.er@");
+ first.append(Authenticator::kSpecialCase);
whywhat 2010/12/30 17:37:39 I'd just use "gmail.com" here to improve readabili
Chris Masone 2010/12/30 18:52:50 ok.
+ std::string second("UsEr@");
+ second.append(Authenticator::kSpecialCase);
+ EXPECT_EQ(Authenticator::Canonicalize(first),
+ Authenticator::Canonicalize(second));
+}
+
+TEST(AuthenticatorTest, EmailAddressIgnoreManyUsernameDots) {
+ std::string first("u.ser@");
+ first.append(Authenticator::kSpecialCase);
+ std::string second("Us.E.r@");
+ second.append(Authenticator::kSpecialCase);
+ EXPECT_EQ(Authenticator::Canonicalize(first),
+ Authenticator::Canonicalize(second));
}
TEST(AuthenticatorTest, EmailAddressIgnoreConsecutiveUsernameDots) {
- EXPECT_EQ(Authenticator::Canonicalize("use.r@what.com"),
- Authenticator::Canonicalize("Us....E.r@what.com"));
+ std::string first("use.r@");
+ first.append(Authenticator::kSpecialCase);
+ std::string second("Us....E.r@");
+ second.append(Authenticator::kSpecialCase);
+ EXPECT_EQ(Authenticator::Canonicalize(first),
+ Authenticator::Canonicalize(second));
}
TEST(AuthenticatorTest, EmailAddressDifferentOnesRejected) {

Powered by Google App Engine
This is Rietveld 408576698