Bug 199300 - [Curl] Fix CookieJarCurl::getRawCookie.
Summary: [Curl] Fix CookieJarCurl::getRawCookie.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-27 17:30 PDT by Takashi Komori
Modified: 2019-07-02 11:29 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.61 KB, patch)
2019-06-27 17:33 PDT, Takashi Komori
no flags Details | Formatted Diff | Diff
Patch (9.46 KB, patch)
2019-07-01 18:19 PDT, Takashi Komori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Komori 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.
Comment 1 Takashi Komori 2019-06-27 17:33:23 PDT
Created attachment 373072 [details]
Patch
Comment 2 Basuke Suzuki 2019-06-27 17:59:53 PDT
This is informal review. Looks good to me.
Comment 3 Fujii Hironori 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?
Comment 4 Fujii Hironori 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?
Comment 5 Fujii Hironori 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.
Comment 6 Fujii Hironori 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".
Comment 7 Fujii Hironori 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)"?
Comment 8 Takashi Komori 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.
Comment 9 Fujii Hironori 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.
Comment 10 Takashi Komori 2019-07-01 18:19:14 PDT
Created attachment 373294 [details]
Patch
Comment 11 Takashi Komori 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?
Comment 12 Takashi Komori 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.
Comment 13 Takashi Komori 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.
Comment 14 Takashi Komori 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.
Comment 15 Takashi Komori 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.
Comment 16 Fujii Hironori 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.
Comment 17 WebKit Commit Bot 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>
Comment 18 WebKit Commit Bot 2019-07-02 11:28:44 PDT
All reviewed patches have been landed.  Closing bug.
Comment 19 Radar WebKit Bug Importer 2019-07-02 11:29:17 PDT
<rdar://problem/52535659>