Bug 223541

Summary: [LayoutTests] Convert http/tests/resourceLoadStatistics convert PHP to Python
Product: WebKit Reporter: Chris Gambrell <cgambrell>
Component: Tools / TestsAssignee: Chris Gambrell <cgambrell>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, ews-watchlist, hi, jbedard, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220749
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Gambrell 2021-03-19 15:26:07 PDT
Replacing PHP with equivalent Python CGI scripts
Comment 1 Radar WebKit Bug Importer 2021-03-19 15:26:28 PDT
<rdar://problem/75639142>
Comment 2 Chris Gambrell 2021-03-19 15:29:21 PDT
Created attachment 423784 [details]
Patch
Comment 3 Chris Gambrell 2021-03-21 06:12:35 PDT
Created attachment 423825 [details]
Patch
Comment 4 Chris Gambrell 2021-03-22 07:11:39 PDT
Created attachment 423879 [details]
Patch
Comment 5 Alex Christensen 2021-03-22 08:53:05 PDT
Comment on attachment 423879 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423879&action=review

> LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py:6
> +    'Cache-Control: no-store\r\n'

Doesn't python support """multi-line string literals"""?

> LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py:10
> +    '<head>\n'

ditto
Comment 6 Chris Gambrell 2021-03-22 13:38:39 PDT
Created attachment 423933 [details]
Patch
Comment 7 Chris Gambrell 2021-03-22 13:39:33 PDT
(In reply to Alex Christensen from comment #5)
> Comment on attachment 423879 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=423879&action=review
> 
> > LayoutTests/http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.py:6
> > +    'Cache-Control: no-store\r\n'
> 
> Doesn't python support """multi-line string literals"""?
> 
> > LayoutTests/http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.py:10
> > +    '<head>\n'
> 
> ditto

Fixed in comment 6
Comment 8 Chris Gambrell 2021-03-24 07:50:12 PDT
Created attachment 424134 [details]
Patch
Comment 9 Jonathan Bedard 2021-03-24 12:07:58 PDT
Comment on attachment 424134 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424134&action=review

> LayoutTests/http/tests/resourceLoadStatistics/resources/set-cookie-on-redirect.py:47
> +    )

Should add an "else" that writes \r\n to stdout so that if something breaks our assumptions here we will still have a valid response

> LayoutTests/http/tests/resourceLoadStatistics/resources/set-cookie.py:16
> +    'Set-Cookie: {}={}; expires={} GMT; Max-Age=2592000; path=/\r\n'

Have enough in here that I think naming your string arguments would be helpful.
Comment 10 Chris Gambrell 2021-03-24 12:29:15 PDT
Created attachment 424167 [details]
Patch
Comment 11 Chris Gambrell 2021-03-24 12:30:38 PDT
(In reply to Jonathan Bedard from comment #9)
> Comment on attachment 424134 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=424134&action=review
> 
> > LayoutTests/http/tests/resourceLoadStatistics/resources/set-cookie-on-redirect.py:47
> > +    )
> 
> Should add an "else" that writes \r\n to stdout so that if something breaks
> our assumptions here we will still have a valid response
> 
> > LayoutTests/http/tests/resourceLoadStatistics/resources/set-cookie.py:16
> > +    'Set-Cookie: {}={}; expires={} GMT; Max-Age=2592000; path=/\r\n'
> 
> Have enough in here that I think naming your string arguments would be
> helpful.

Fixed in comment 10
Comment 12 EWS 2021-03-24 14:32:42 PDT
Committed r274975: <https://commits.webkit.org/r274975>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 424167 [details].
Comment 13 Chris Gambrell 2021-04-15 14:39:09 PDT
Reopening for last PHP file to convert to Python
Comment 14 Chris Gambrell 2021-04-15 14:44:39 PDT
Created attachment 426139 [details]
Patch
Comment 15 EWS 2021-04-15 19:47:07 PDT
Committed r276109 (236609@main): <https://commits.webkit.org/236609@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426139 [details].