Chromium Code Reviews| 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) { |