WebKit Bugzilla
Attachment 373072 Details for
Bug 199300
: [Curl] Fix CookieJarCurl::getRawCookie.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199300-20190628092921.patch (text/plain), 10.61 KB, created by
Takashi Komori
on 2019-06-27 17:33:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-06-27 17:33:23 PDT
Size:
10.61 KB
patch
obsolete
>Subversion Revision: 246781 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e54e326efc2bf11e128d7381707896b884fb7179..24b5c88aac079570724d2035d35421e99901a2f2 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-27 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Fix CookieJarCurl::getRawCookie. >+ https://bugs.webkit.org/show_bug.cgi?id=199300 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/tests/inspector/page/get-cookies.html >+ >+ * platform/network/curl/CookieJarCurl.cpp: >+ (WebCore::CookieJarCurl::getRawCookies const): >+ > 2019-06-24 Wenson Hsieh <wenson_hsieh@apple.com> > > [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates >diff --git a/Source/WebCore/platform/network/curl/CookieJarCurl.cpp b/Source/WebCore/platform/network/curl/CookieJarCurl.cpp >index 29b4005025330079af4572ab9daca6c5d83eb028..394c34626649d5dea869e095be0d9fae7b1a5ecb 100644 >--- a/Source/WebCore/platform/network/curl/CookieJarCurl.cpp >+++ b/Source/WebCore/platform/network/curl/CookieJarCurl.cpp >@@ -112,13 +112,13 @@ bool CookieJarCurl::cookiesEnabled(const NetworkStorageSession& session) const > return session.cookieDatabase().isEnabled(); > } > >-bool CookieJarCurl::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<PageIdentifier> pageID, Vector<Cookie>& rawCookies) const >+bool CookieJarCurl::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const SameSiteInfo&, const URL& url, Optional<uint64_t> frameID, Optional<PageIdentifier> pageID, Vector<Cookie>& rawCookies) const > { > UNUSED_PARAM(frameID); > UNUSED_PARAM(pageID); > > CookieJarDB& cookieJarDB = session.cookieDatabase(); >- if (auto cookies = cookieJarDB.searchCookies(firstParty, firstParty, WTF::nullopt, WTF::nullopt, WTF::nullopt)) { >+ if (auto cookies = cookieJarDB.searchCookies(firstParty, url, WTF::nullopt, WTF::nullopt, WTF::nullopt)) { > rawCookies = WTFMove(*cookies); > return true; > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8a9fa8f70b0548514aa1cc78e2008761a3babf4b..1229886851d28b777887ab098cd288c32d5defff 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-27 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Fix CookieJarCurl::getRawCookie. >+ https://bugs.webkit.org/show_bug.cgi?id=199300 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/inspector/page/get-cookies-expected.txt: Added. >+ * http/tests/inspector/page/get-cookies.html: Added. >+ * http/tests/inspector/page/resources/set-cookie.php: Added. >+ * platform/wincairo-wk1/TestExpectations: >+ * platform/wincairo/TestExpectations: >+ > 2019-06-24 Wenson Hsieh <wenson_hsieh@apple.com> > > [Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates >diff --git a/LayoutTests/http/tests/inspector/page/get-cookies-expected.txt b/LayoutTests/http/tests/inspector/page/get-cookies-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..f2efd2912fbe45561c39be7e6edb1edc8c83bcb9 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/page/get-cookies-expected.txt >@@ -0,0 +1,26 @@ >+Test for the Page.getCookies >+ >+ >+== Running test suite: Page.getCookies >+-- Running test case: CheckNoCookies >+PASS: Should be no cookies. >+ >+-- Running test setup. >+-- Running test case: Page.getCookies.OnlyMainResource >+PASS: length should be one. >+PASS: [Main] Name is 'Main' >+PASS: [Main] Value is '127.0.0.1' >+PASS: [Main] Domain is '127.0.0.1' >+ >+-- Running test case: Page.getCookies.MainAndSubResource >+PASS: length should be two. >+PASS: [Sub] Name is 'Sub' >+PASS: [Sub] Value is 'local' >+PASS: [Sub] Domain is 'localhost' >+ >+-- Running test case: Page.getCookies.MainAndSubResource >+PASS: length should be three. >+PASS: [Sub] Name is 'Sub' >+PASS: [Sub] Value is '127.0.0.1' >+PASS: [Sub] Domain is '127.0.0.1' >+ >diff --git a/LayoutTests/http/tests/inspector/page/get-cookies.html b/LayoutTests/http/tests/inspector/page/get-cookies.html >new file mode 100644 >index 0000000000000000000000000000000000000000..832f7563fe66e47507d262e220614d99444b535f >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/page/get-cookies.html >@@ -0,0 +1,102 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../resources/inspector-test.js"></script> >+<script> >+if (window.testRunner) >+ testRunner.setAlwaysAcceptCookies(true); >+ >+function loadDocumentWithURL(url) { >+ frame = document.createElement('iframe'); >+ frame.src = url; >+ frame.onload = function() { TestPage.dispatchEventToFrontend("LoadComplete") }; >+ document.body.appendChild(frame); >+} >+ >+function test() >+{ >+ let suite = InspectorTest.createAsyncSuite("Page.getCookies"); >+ >+ suite.addTestCase({ >+ name: "CheckNoCookies", >+ description: "Ensure there are no cookies.", >+ test(resolve, reject) { >+ PageAgent.getCookies().then((payload) => { >+ InspectorTest.expectEqual(payload.cookies.length, 0, "Should be no cookies."); >+ resolve(); >+ }).catch((error) => { >+ InspectorTest.log(error); >+ reject(); >+ }); >+ } >+ }); >+ >+ suite.addTestCase({ >+ name: "Page.getCookies.OnlyMainResource", >+ description: "Get cookies on MainResource", >+ setup(resolve) { >+ InspectorTest.evaluateInPage(`document.cookie = "Main=127.0.0.1; Max-age=3600";`); >+ setTimeout(resolve, 500); >+ }, >+ test(resolve, reject) { >+ PageAgent.getCookies().then((payload) => { >+ InspectorTest.expectEqual(payload.cookies.length, 1, "length should be one."); >+ InspectorTest.expectEqual(payload.cookies[0].name, "Main", "[Main] Name is 'Main'"); >+ InspectorTest.expectEqual(payload.cookies[0].value, "127.0.0.1", "[Main] Value is '127.0.0.1'"); >+ InspectorTest.expectEqual(payload.cookies[0].domain, "127.0.0.1", "[Main] Domain is '127.0.0.1'"); >+ resolve(); >+ }).catch((error) => { >+ InspectorTest.log("Could not fetch cookies: " + error); >+ reject(); >+ }); >+ } >+ }); >+ >+ suite.addTestCase({ >+ name: "Page.getCookies.MainAndSubResource", >+ description: "Get cookies on Main and SubResource (localhost)", >+ test(resolve, reject) { >+ InspectorTest.evaluateInPage(`loadDocumentWithURL("http://localhost:8000/inspector/page/resources/set-cookie.php?name=Sub&value=local")`); >+ InspectorTest.awaitEvent("LoadComplete").then((event) => { >+ PageAgent.getCookies().then((payload) => { >+ InspectorTest.expectEqual(payload.cookies.length, 2, "length should be two."); >+ InspectorTest.expectEqual(payload.cookies[1].name, "Sub", "[Sub] Name is 'Sub'"); >+ InspectorTest.expectEqual(payload.cookies[1].value, "local", "[Sub] Value is 'local'"); >+ InspectorTest.expectEqual(payload.cookies[1].domain, "localhost", "[Sub] Domain is 'localhost'"); >+ resolve(); >+ }).catch((error) => { >+ InspectorTest.log("Could not fetch cookies: " + error); >+ reject(); >+ }); >+ }); >+ } >+ }); >+ >+ suite.addTestCase({ >+ name: "Page.getCookies.MainAndSubResource", >+ description: "Get cookies on Main and SubResources (localhost / 127.0.0.1)", >+ test(resolve, reject) { >+ InspectorTest.evaluateInPage(`loadDocumentWithURL("http://127.0.0.1:8000/inspector/page/resources/set-cookie.php?name=Sub&value=127.0.0.1")`); >+ InspectorTest.awaitEvent("LoadComplete").then((event) => { >+ PageAgent.getCookies().then((payload) => { >+ InspectorTest.expectEqual(payload.cookies.length, 3, "length should be three."); >+ InspectorTest.expectEqual(payload.cookies[2].name, "Sub", "[Sub] Name is 'Sub'"); >+ InspectorTest.expectEqual(payload.cookies[2].value, "127.0.0.1", "[Sub] Value is '127.0.0.1'"); >+ InspectorTest.expectEqual(payload.cookies[2].domain, "127.0.0.1", "[Sub] Domain is '127.0.0.1'"); >+ resolve(); >+ }).catch((error) => { >+ InspectorTest.log("Could not fetch cookies: " + error); >+ reject(); >+ }); >+ }); >+ } >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+</script> >+</head> >+<body onload="runTest()"> >+ <p>Test for the Page.getCookies</p> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/inspector/page/resources/set-cookie.php b/LayoutTests/http/tests/inspector/page/resources/set-cookie.php >new file mode 100644 >index 0000000000000000000000000000000000000000..1f8a22b3dcb314888983207fddfea9588b622a77 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/page/resources/set-cookie.php >@@ -0,0 +1,4 @@ >+<?php >+ setcookie($_GET["name"], $_GET["value"], time() + 3600); >+?> >+Set <?= $_GET["name"] ?>=<?= $_GET["value"] ?> >diff --git a/LayoutTests/platform/wincairo-wk1/TestExpectations b/LayoutTests/platform/wincairo-wk1/TestExpectations >index 9a53fb8751dfca3b30e103f1e584e5464f3e7eb0..5d10817a34a788c24bed01693a45db50fd791da3 100644 >--- a/LayoutTests/platform/wincairo-wk1/TestExpectations >+++ b/LayoutTests/platform/wincairo-wk1/TestExpectations >@@ -298,6 +298,7 @@ webkit.org/b/89153 http/tests/websocket/tests/hybi/workers/close.html [ Pass Fai > # Cookie policy only supported in WK2. > http/tests/cookies/only-accept-first-party-cookies.html [ Skip ] > http/tests/cookies/third-party-cookie-relaxing.html [ Skip ] >+http/tests/inspector/page/get-cookies.html [ Skip ] > http/tests/security/cookies/third-party-cookie-blocking.html [ Skip ] > http/tests/security/cookies/third-party-cookie-blocking-redirect.html [ Skip ] > http/tests/security/cookies/third-party-cookie-blocking-user-action.html [ Skip ] >diff --git a/LayoutTests/platform/wincairo/TestExpectations b/LayoutTests/platform/wincairo/TestExpectations >index f0b344d5bfc659f00c63cc4becb1d25632f20e3c..1f7ec27d8f8298152f7773dc5a488d2733b66689 100644 >--- a/LayoutTests/platform/wincairo/TestExpectations >+++ b/LayoutTests/platform/wincairo/TestExpectations >@@ -884,6 +884,8 @@ http/tests/history [ Skip ] > http/tests/images [ Skip ] > http/tests/incremental [ Skip ] > http/tests/inspector [ Skip ] >+http/tests/inspector/page/get-cookies.html [ Pass ] >+ > http/tests/loading [ Skip ] > http/tests/local/blob [ Skip ] > http/tests/local/fileapi [ Skip ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199300
:
373072
|
373294