WebKit Bugzilla
Attachment 373294 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-20190702101514.patch (text/plain), 9.46 KB, created by
Takashi Komori
on 2019-07-01 18:19:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Takashi Komori
Created:
2019-07-01 18:19:14 PDT
Size:
9.46 KB
patch
obsolete
>Subversion Revision: 246781 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e54e326efc2bf11e128d7381707896b884fb7179..8e37268f872e3d4ac832aa6bbafd5fab05e4a30b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-07-01 Takashi Komori <Takashi.Komori@sony.com> >+ >+ [Curl] Fix CookieJarCurl::getRawCookie. >+ https://bugs.webkit.org/show_bug.cgi?id=199300 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ On wincairo some cookie information was not displayed in WebInspector's storage tab as >+ CookieJarCurl::getRawCookies was calling CookieJarDB::searchCookies with wrong arguments. >+ This patch fixes it. >+ >+ 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..4b085bb5f77a68e9b312937557318cb97d072adc 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-07-01 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..bd7f3bfa3ad98e8ef21ff03ea0d0b7950b38146e >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/page/get-cookies-expected.txt >@@ -0,0 +1,21 @@ >+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 'foo' >+PASS: [Main] Domain is '127.0.0.1' >+ >+-- Running test setup. >+-- Running test case: Page.getCookies.SubResource >+PASS: length should be two. >+PASS: [Sub] Name is 'Sub' >+PASS: [Sub] Value is 'bar' >+PASS: [Sub] Domain is 'localhost' >+ >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..ff75ddc4dfb1c9d79c9414d4ef90926a86186e39 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/page/get-cookies.html >@@ -0,0 +1,83 @@ >+<!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=foo; 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, "foo", "[Main] Value is 'foo'"); >+ 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.SubResource", >+ description: "Get cookies on SubResources.", >+ setup(resolve) { >+ InspectorTest.awaitEvent("LoadComplete").then((event) => { resolve() }); >+ InspectorTest.evaluateInPage(`loadDocumentWithURL("http://localhost:8000/inspector/page/resources/set-cookie.php?name=Sub&value=bar")`); >+ }, >+ test(resolve, reject) { >+ 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, "bar", "[Sub] Value is 'bar'"); >+ InspectorTest.expectEqual(payload.cookies[1].domain, "localhost", "[Sub] Domain is 'localhost'"); >+ 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