Index: google_apis/gaia/gaia_auth_util_unittest.cc |
diff --git a/google_apis/gaia/gaia_auth_util_unittest.cc b/google_apis/gaia/gaia_auth_util_unittest.cc |
index 352c03286d40891d704d6ba8db78f9548e3c4a92..5a60ebc1d3525333bef3b997dc1a228895dcdeff 100644 |
--- a/google_apis/gaia/gaia_auth_util_unittest.cc |
+++ b/google_apis/gaia/gaia_auth_util_unittest.cc |
@@ -4,6 +4,7 @@ |
#include "google_apis/gaia/gaia_auth_util.h" |
+#include "googleurl/src/gurl.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace gaia { |
@@ -84,4 +85,19 @@ TEST(GaiaAuthUtilTest, SanitizeExistingDomain) { |
EXPECT_EQ(existing, SanitizeEmail(existing)); |
} |
+TEST(GaiaAuthUtilTest, IsGaiaSignonRealm) { |
+ // Only https versions of Gaia URLs should be considered valid. |
+ EXPECT_TRUE(IsGaiaSignonRealm(GURL("https://accounts.google.com/"))); |
+ EXPECT_TRUE(IsGaiaSignonRealm(GURL("https://www.google.com/"))); |
+ EXPECT_FALSE(IsGaiaSignonRealm(GURL("http://accounts.google.com/"))); |
+ EXPECT_FALSE(IsGaiaSignonRealm(GURL("http://www.google.com/"))); |
+ |
+ // Other Google URLs are not valid. |
+ EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://google.com/"))); |
+ EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://mail.google.com/"))); |
+ |
+ // Other https URLs are not valid. |
+ EXPECT_FALSE(IsGaiaSignonRealm(GURL("https://www.example.com/"))); |
+} |
+ |
} // namespace gaia |