RESOLVED FIXED 199300
[Curl] Fix CookieJarCurl::getRawCookie.
https://bugs.webkit.org/show_bug.cgi?id=199300
Summary [Curl] Fix CookieJarCurl::getRawCookie.
Takashi Komori
Reported 2019-06-27 17:30:58 PDT
CookieJarCurl::getRawCookies is not working correctly because it uses CookieJarDB::searchCookies wrongly. This function is used for displaying cookie data in the web inspector storage tab.
Attachments
Patch (10.61 KB, patch)
2019-06-27 17:33 PDT, Takashi Komori
no flags
Patch (9.46 KB, patch)
2019-07-01 18:19 PDT, Takashi Komori
no flags
Takashi Komori
Comment 1 2019-06-27 17:33:23 PDT
Basuke Suzuki
Comment 2 2019-06-27 17:59:53 PDT
This is informal review. Looks good to me.
Fujii Hironori
Comment 3 2019-06-27 23:36:52 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review > Source/WebCore/ChangeLog:3 > + [Curl] Fix CookieJarCurl::getRawCookie. Please be more informative. What is the problem, or how do you fix. > LayoutTests/platform/wincairo-wk1/TestExpectations:301 > +http/tests/inspector/page/get-cookies.html [ Skip ] Why is it skipped? This test is only for WK2? Then, does mac-wk1 also need to skip?
Fujii Hironori
Comment 4 2019-06-27 23:54:27 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review > LayoutTests/ChangeLog:9 > + * http/tests/inspector/page/get-cookies.html: Added. This test really should be in 'page' directory? There is LayoutTests/inspector/storage directory. Do you need to create LayoutTests/http/tests/inspector/storage directory?
Fujii Hironori
Comment 5 2019-06-27 23:59:53 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review > LayoutTests/http/tests/inspector/page/get-cookies.html:60 > + InspectorTest.awaitEvent("LoadComplete").then((event) => { Should you call InspectorTest.awaitEvent() before InspectorTest.evaluateInPage()? It seems that other test do so.
Fujii Hironori
Comment 6 2019-06-28 00:03:28 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review > LayoutTests/http/tests/inspector/page/get-cookies.html:85 > + InspectorTest.expectEqual(payload.cookies[2].domain, "127.0.0.1", "[Sub] Domain is '127.0.0.1'"); test value for 'value' should be other value than domain. For examle, "xyz".
Fujii Hironori
Comment 7 2019-06-28 00:05:52 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review > LayoutTests/http/tests/inspector/page/get-cookies.html:77 > + description: "Get cookies on Main and SubResources (localhost / 127.0.0.1)", Why do you need two tests, "Get cookies on Main and SubResource (localhost)" and "Get cookies on Main and SubResources (localhost / 127.0.0.1)"?
Takashi Komori
Comment 8 2019-06-28 00:29:08 PDT
(In reply to Fujii Hironori from comment #5) > Comment on attachment 373072 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373072&action=review > > > LayoutTests/http/tests/inspector/page/get-cookies.html:60 > > + InspectorTest.awaitEvent("LoadComplete").then((event) => { > > Should you call InspectorTest.awaitEvent() before > InspectorTest.evaluateInPage()? It seems that other test do so. In this part we evaluate 'loadDocumentWithURL()' in test page and wait the results of the evaluation, and then check results. So if we call evaluateInPage() before awaitEvent(), this test doesn't work.
Fujii Hironori
Comment 9 2019-06-28 04:09:43 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review >>> LayoutTests/http/tests/inspector/page/get-cookies.html:60 >>> + InspectorTest.awaitEvent("LoadComplete").then((event) => { >> >> Should you call InspectorTest.awaitEvent() before InspectorTest.evaluateInPage()? It seems that other test do so. > > In this part we evaluate 'loadDocumentWithURL()' in test page and wait the results of the evaluation, and then check results. > So if we call evaluateInPage() before awaitEvent(), this test doesn't work. Do you mean "if we call awaitEvent() before evaluateInPage()"? Why? I think awaitEvent should be called before evaluateInPage because it needs to register a event listener before start loading.
Takashi Komori
Comment 10 2019-07-01 18:19:14 PDT
Takashi Komori
Comment 11 2019-07-01 18:23:11 PDT
(In reply to Fujii Hironori from comment #3) > Comment on attachment 373072 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373072&action=review > > > Source/WebCore/ChangeLog:3 > > + [Curl] Fix CookieJarCurl::getRawCookie. > > Please be more informative. What is the problem, or how do you fix. > > > LayoutTests/platform/wincairo-wk1/TestExpectations:301 > > +http/tests/inspector/page/get-cookies.html [ Skip ] > > Why is it skipped? This test is only for WK2? Then, does mac-wk1 also need > to skip? Because almost all inspector tests don't work on wincairo DRT. I think mac-wk1 skips it because top level TestExpectations skips http/test/inspector/page/ directory and TestExpectations for mac-wk1 doesn't mention this test. Is it correct?
Takashi Komori
Comment 12 2019-07-01 18:23:54 PDT
(In reply to Fujii Hironori from comment #4) > Comment on attachment 373072 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373072&action=review > > > LayoutTests/ChangeLog:9 > > + * http/tests/inspector/page/get-cookies.html: Added. > > This test really should be in 'page' directory? There is > LayoutTests/inspector/storage directory. Do you need to create > LayoutTests/http/tests/inspector/storage directory? If http/tests/inspector/storage/ is properer position than http/tests/inspector/page/ for this test, we will move it. I would like to know the more detailed reasonings for changing the path.
Takashi Komori
Comment 13 2019-07-01 18:25:14 PDT
(In reply to Fujii Hironori from comment #6) > Comment on attachment 373072 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373072&action=review > > > LayoutTests/http/tests/inspector/page/get-cookies.html:85 > > + InspectorTest.expectEqual(payload.cookies[2].domain, "127.0.0.1", "[Sub] Domain is '127.0.0.1'"); > > test value for 'value' should be other value than domain. For examle, "xyz". Fixed.
Takashi Komori
Comment 14 2019-07-01 18:26:25 PDT
(In reply to Fujii Hironori from comment #7) > Comment on attachment 373072 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373072&action=review > > > LayoutTests/http/tests/inspector/page/get-cookies.html:77 > > + description: "Get cookies on Main and SubResources (localhost / 127.0.0.1)", > > Why do you need two tests, "Get cookies on Main and SubResource (localhost)" > and "Get cookies on Main and SubResources (localhost / 127.0.0.1)"? Removed extra test.
Takashi Komori
Comment 15 2019-07-01 18:27:27 PDT
(In reply to Fujii Hironori from comment #9) > Comment on attachment 373072 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=373072&action=review > > >>> LayoutTests/http/tests/inspector/page/get-cookies.html:60 > >>> + InspectorTest.awaitEvent("LoadComplete").then((event) => { > >> > >> Should you call InspectorTest.awaitEvent() before InspectorTest.evaluateInPage()? It seems that other test do so. > > > > In this part we evaluate 'loadDocumentWithURL()' in test page and wait the results of the evaluation, and then check results. > > So if we call evaluateInPage() before awaitEvent(), this test doesn't work. > > Do you mean "if we call awaitEvent() before evaluateInPage()"? > Why? I think awaitEvent should be called before evaluateInPage because it > needs to register a event listener before start loading. I misunderstood. Fixed.
Fujii Hironori
Comment 16 2019-07-01 18:52:56 PDT
Comment on attachment 373072 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=373072&action=review >>> LayoutTests/ChangeLog:9 >>> + * http/tests/inspector/page/get-cookies.html: Added. >> >> This test really should be in 'page' directory? There is LayoutTests/inspector/storage directory. Do you need to create LayoutTests/http/tests/inspector/storage directory? > > If http/tests/inspector/storage/ is properer position than http/tests/inspector/page/ for this test, we will move it. > I would like to know the more detailed reasonings for changing the path. There is LayoutTests/inspector/page/filter-cookies-for-domain.html which is tesing "Page.getCookie". Your test case is testing "Page.getCookies". http/tests/inspector/page seems appropriate.
WebKit Commit Bot
Comment 17 2019-07-02 11:28:42 PDT
Comment on attachment 373294 [details] Patch Clearing flags on attachment: 373294 Committed r247064: <https://trac.webkit.org/changeset/247064>
WebKit Commit Bot
Comment 18 2019-07-02 11:28:44 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 19 2019-07-02 11:29:17 PDT
Note You need to log in before you can comment on or make changes to this bug.