Index: Source/web/tests/WebDocumentTest.cpp |
diff --git a/Source/web/tests/WebDocumentTest.cpp b/Source/web/tests/WebDocumentTest.cpp |
index 6d8008f451d3a4497b00314c7ac806b17a28a3e6..ca1f19a87fd75f6b3b9e04988231243699e77e9a 100644 |
--- a/Source/web/tests/WebDocumentTest.cpp |
+++ b/Source/web/tests/WebDocumentTest.cpp |
@@ -12,11 +12,12 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/html/HTMLElement.h" |
#include "core/html/HTMLLinkElement.h" |
-#include "core/style/ComputedStyle.h" |
#include "core/page/Page.h" |
+#include "core/style/ComputedStyle.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/graphics/Color.h" |
#include "platform/testing/URLTestHelpers.h" |
+#include "platform/weborigin/SchemeRegistry.h" |
#include "platform/weborigin/SecurityOrigin.h" |
#include "web/tests/FrameTestHelpers.h" |
#include <gtest/gtest.h> |
@@ -296,4 +297,15 @@ TEST_F(WebDocumentFirstPartyTest, NestedData) |
ASSERT_EQ(SecurityOrigin::urlWithUniqueSecurityOrigin(), nestedDocument()->firstPartyForCookies()); |
} |
+TEST_F(WebDocumentFirstPartyTest, NestedOriginAInOriginBWithFirstPartyOverride) |
+{ |
+ load(nestedOriginAInOriginB); |
+ |
+ SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel("http"); |
+ |
+ ASSERT_EQ(toOriginA(nestedOriginAInOriginB), topDocument()->firstPartyForCookies()); |
+ ASSERT_EQ(toOriginA(nestedOriginAInOriginB), nestedDocument()->firstPartyForCookies()); |
+ ASSERT_EQ(toOriginA(nestedOriginAInOriginB), nestedNestedDocument()->firstPartyForCookies()); |
+} |
+ |
} // namespace blink |