Index: third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp |
diff --git a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp |
index e500aa4f3b7e3e592064448efc308644221ca35b..dd41730457b07b20caec48262378d17ce38078f6 100644 |
--- a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp |
+++ b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntryTest.cpp |
@@ -100,24 +100,26 @@ TEST(OriginAccessEntryTest, AllowSubdomainsTest) |
const char* protocol; |
const char* host; |
const char* origin; |
- OriginAccessEntry::MatchResult expected; |
+ OriginAccessEntry::MatchResult expectedOrigin; |
+ OriginAccessEntry::MatchResult expectedDomain; |
} inputs[] = { |
- { "http", "example.com", "http://example.com/", OriginAccessEntry::MatchesOrigin }, |
- { "http", "example.com", "http://www.example.com/", OriginAccessEntry::MatchesOrigin }, |
- { "http", "example.com", "http://www.www.example.com/", OriginAccessEntry::MatchesOrigin }, |
- { "http", "www.example.com", "http://example.com/", OriginAccessEntry::DoesNotMatchOrigin }, |
- { "http", "www.example.com", "http://www.example.com/", OriginAccessEntry::MatchesOrigin }, |
- { "http", "www.example.com", "http://www.www.example.com/", OriginAccessEntry::MatchesOrigin }, |
- { "http", "com", "http://example.com/", OriginAccessEntry::MatchesOriginButIsPublicSuffix }, |
- { "http", "com", "http://www.example.com/", OriginAccessEntry::MatchesOriginButIsPublicSuffix }, |
- { "http", "com", "http://www.www.example.com/", OriginAccessEntry::MatchesOriginButIsPublicSuffix }, |
- { "https", "example.com", "http://example.com/", OriginAccessEntry::DoesNotMatchOrigin }, |
- { "https", "example.com", "http://www.example.com/", OriginAccessEntry::DoesNotMatchOrigin }, |
- { "https", "example.com", "http://www.www.example.com/", OriginAccessEntry::DoesNotMatchOrigin }, |
- { "http", "example.com", "http://beispiel.de/", OriginAccessEntry::DoesNotMatchOrigin }, |
- { "http", "", "http://example.com/", OriginAccessEntry::MatchesOrigin }, |
- { "http", "", "http://beispiel.de/", OriginAccessEntry::MatchesOrigin }, |
- { "https", "", "http://beispiel.de/", OriginAccessEntry::DoesNotMatchOrigin }, |
+ { "http", "example.com", "http://example.com/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "example.com", "http://www.example.com/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "example.com", "http://www.www.example.com/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "www.example.com", "http://example.com/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::DoesNotMatchOrigin }, |
+ { "http", "www.example.com", "http://www.example.com/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "www.example.com", "http://www.www.example.com/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "com", "http://example.com/", OriginAccessEntry::MatchesOriginButIsPublicSuffix, OriginAccessEntry::MatchesOriginButIsPublicSuffix }, |
+ { "http", "com", "http://www.example.com/", OriginAccessEntry::MatchesOriginButIsPublicSuffix, OriginAccessEntry::MatchesOriginButIsPublicSuffix }, |
+ { "http", "com", "http://www.www.example.com/", OriginAccessEntry::MatchesOriginButIsPublicSuffix, OriginAccessEntry::MatchesOriginButIsPublicSuffix }, |
+ { "https", "example.com", "http://example.com/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "https", "example.com", "http://www.example.com/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "https", "example.com", "http://www.www.example.com/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "example.com", "http://beispiel.de/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::DoesNotMatchOrigin }, |
+ { "http", "example.com", "https://beispiel.de/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::DoesNotMatchOrigin }, |
+ { "http", "", "http://example.com/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "http", "", "http://beispiel.de/", OriginAccessEntry::MatchesOrigin, OriginAccessEntry::MatchesOrigin }, |
+ { "https", "", "http://beispiel.de/", OriginAccessEntry::DoesNotMatchOrigin, OriginAccessEntry::MatchesOrigin }, |
}; |
OriginAccessEntryTestPlatform platform; |
@@ -128,7 +130,8 @@ TEST(OriginAccessEntryTest, AllowSubdomainsTest) |
SCOPED_TRACE(testing::Message() << "Host: " << test.host << ", Origin: " << test.origin); |
RefPtr<SecurityOrigin> originToTest = SecurityOrigin::createFromString(test.origin); |
OriginAccessEntry entry1(test.protocol, test.host, OriginAccessEntry::AllowSubdomains); |
- EXPECT_EQ(test.expected, entry1.matchesOrigin(*originToTest)); |
+ EXPECT_EQ(test.expectedOrigin, entry1.matchesOrigin(*originToTest)); |
+ EXPECT_EQ(test.expectedDomain, entry1.matchesDomain(*originToTest)); |
} |
Platform::shutdown(); |