OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "google_apis/gaia/gaia_auth_util.h" | 5 #include "google_apis/gaia/gaia_auth_util.h" |
6 | 6 |
7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace gaia { | 10 namespace gaia { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 TEST(GaiaAuthUtilTest, SanitizeExistingDomain) { | 83 TEST(GaiaAuthUtilTest, SanitizeExistingDomain) { |
84 const char existing[] = "test@example.com"; | 84 const char existing[] = "test@example.com"; |
85 EXPECT_EQ(existing, SanitizeEmail(existing)); | 85 EXPECT_EQ(existing, SanitizeEmail(existing)); |
86 } | 86 } |
87 | 87 |
88 TEST(GaiaAuthUtilTest, IsGaiaSignonRealm) { | 88 TEST(GaiaAuthUtilTest, IsGaiaSignonRealm) { |
89 // Only https versions of Gaia URLs should be considered valid. | 89 // Only https versions of Gaia URLs should be considered valid. |
90 EXPECT_TRUE(IsGaiaSignonRealm(GURL("https://accounts.google.com/"))); | 90 EXPECT_TRUE(IsGaiaSignonRealm(GURL("https://accounts.google.com/"))); |
91 EXPECT_TRUE(IsGaiaSignonRealm(GURL("https://www.google.com/"))); | |
92 EXPECT_FALSE(IsGaiaSignonRealm(GURL("http://accounts.google.com/"))); | 91 EXPECT_FALSE(IsGaiaSignonRealm(GURL("http://accounts.google.com/"))); |
93 EXPECT_FALSE(IsGaiaSignonRealm(GURL("http://www.google.com/"))); | |
94 | 92 |
95 // Other Google URLs are not valid. | 93 // Other Google URLs are not valid. |
| 94 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://www.google.com/"))); |
| 95 EXPECT_FALSE(IsGaiaSignonRealm(GURL("http://www.google.com/"))); |
96 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://google.com/"))); | 96 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://google.com/"))); |
97 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://mail.google.com/"))); | 97 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://mail.google.com/"))); |
98 | 98 |
99 // Other https URLs are not valid. | 99 // Other https URLs are not valid. |
100 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://www.example.com/"))); | 100 EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://www.example.com/"))); |
101 } | 101 } |
102 | 102 |
103 } // namespace gaia | 103 } // namespace gaia |
OLD | NEW |