Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1105)

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2046593003: Fix Document::firstPartyForCookies() for OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the top frame in the remote case and add a test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index b2d4ad274c57325a801197399a9ac6e4980b9bcb..1eb99681726292aa5947534a22dd645ddffa958c 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -8108,6 +8108,28 @@ TEST_P(ParameterizedWebFrameTest, SendBeaconFromChildWithRemoteMainFrame)
view->close();
}
+TEST_P(ParameterizedWebFrameTest, FirstPartyForCookiesFromChildWithRemoteMainFrame)
+{
+ FrameTestHelpers::TestWebViewClient viewClient;
+ FrameTestHelpers::TestWebRemoteFrameClient remoteClient;
+ WebView* view = WebView::create(&viewClient);
+ view->setMainFrame(remoteClient.frame());
+ WebRemoteFrame* root = view->mainFrame()->toWebRemoteFrame();
+ root->setReplicatedOrigin(SecurityOrigin::create(toKURL(m_notBaseURL)));
+
+ WebLocalFrame* localFrame = FrameTestHelpers::createLocalChild(root);
+
+ registerMockedHttpURLLoad("foo.html");
+ FrameTestHelpers::loadFrame(localFrame, m_baseURL + "foo.html");
+ EXPECT_EQ(WebURL(SecurityOrigin::urlWithUniqueSecurityOrigin()), localFrame->document().firstPartyForCookies());
+
+ SchemeRegistry::registerURLSchemeAsFirstPartyWhenTopLevel("http");
+ EXPECT_EQ(WebURL(toKURL(m_notBaseURL)), localFrame->document().firstPartyForCookies());
+ SchemeRegistry::removeURLSchemeAsFirstPartyWhenTopLevel("http");
+
+ view->close();
+}
+
// See https://crbug.com/525285.
TEST_P(ParameterizedWebFrameTest, RemoteToLocalSwapOnMainFrameInitializesCoreFrame)
{
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698