Bug 222198 - [LayoutTests] Convert http/tests/loading convert PHP to Python
Summary: [LayoutTests] Convert http/tests/loading convert PHP to Python
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Gambrell
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-19 14:02 PST by Chris Gambrell
Modified: 2021-04-06 11:00 PDT (History)
6 users (show)

See Also:


Attachments
Patch (73.87 KB, patch)
2021-02-23 14:19 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (60.80 KB, patch)
2021-02-23 15:01 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (118.83 KB, patch)
2021-02-24 08:04 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (102.54 KB, patch)
2021-02-24 10:01 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (104.04 KB, patch)
2021-03-01 09:39 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (102.57 KB, patch)
2021-03-01 10:34 PST, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (17.07 KB, patch)
2021-03-31 19:25 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (17.03 KB, patch)
2021-04-01 19:09 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff
Patch (17.14 KB, patch)
2021-04-02 12:14 PDT, Chris Gambrell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Gambrell 2021-02-19 14:02:51 PST
Replacing PHP with equivalent Python CGI scripts
Comment 1 Radar WebKit Bug Importer 2021-02-19 14:03:11 PST
<rdar://problem/74536576>
Comment 2 Chris Gambrell 2021-02-23 14:19:18 PST
Created attachment 421349 [details]
Patch
Comment 3 Chris Gambrell 2021-02-23 15:01:59 PST
Created attachment 421355 [details]
Patch
Comment 4 Chris Gambrell 2021-02-24 08:04:11 PST
Created attachment 421411 [details]
Patch
Comment 5 Chris Gambrell 2021-02-24 10:01:10 PST
Created attachment 421419 [details]
Patch
Comment 6 Jonathan Bedard 2021-02-25 11:19:40 PST
Comment on attachment 421419 [details]
Patch

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

> LayoutTests/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/resources/wrong-credential-1-redirect-to-auth.php:-3
> -// That is important, and the next page has to be loaded using 127.0.0.1.

I think you should retain this comment in the python code, even though it isn't in the request

> LayoutTests/http/tests/loading/resourceLoadStatistics/resources/set-cookie.php:-9
> -</script>

This file is being removed, but not replaced. Is it not used anywhere? If not, it's fine to remove it (it's a resource, so it is not itself a test)

> LayoutTests/http/tests/loading/resources/imported-stylesheet-varying-according-domain.css.py:10
> +color = ''

You can do this in a one-liner:

color = 'green' if host == domain else 'red'

> LayoutTests/http/tests/loading/resources/imported-stylesheet-varying-according-domain.css.py:19
> +    'body {{ background-color: {};}}'.format(color)

You may actually consider putting the one-liner as the format argument

> LayoutTests/http/tests/loading/resources/post-in-iframe-with-back-navigation-page-1.py:6
> +today = time.time()

Nit: I'd call this variable "now" since it isn't just the day

> LayoutTests/http/tests/loading/resources/post-in-iframe-with-back-navigation-page-2.py:6
> +today = time.time()

Nit: I'd call this variable "now" since it isn't just the day

> LayoutTests/http/tests/loading/resources/post-in-iframe-with-back-navigation-page-3.py:6
> +today = time.time()

Nit: I'd call this variable "now" since it isn't just the day
Comment 7 Chris Gambrell 2021-03-01 09:39:34 PST
Created attachment 421835 [details]
Patch
Comment 8 Chris Gambrell 2021-03-01 09:40:17 PST
(In reply to Jonathan Bedard from comment #6)
> Comment on attachment 421419 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=421419&action=review
> 
> > LayoutTests/http/tests/loading/authentication-after-redirect-stores-wrong-credentials/resources/wrong-credential-1-redirect-to-auth.php:-3
> > -// That is important, and the next page has to be loaded using 127.0.0.1.
> 
> I think you should retain this comment in the python code, even though it
> isn't in the request
> 
> > LayoutTests/http/tests/loading/resourceLoadStatistics/resources/set-cookie.php:-9
> > -</script>
> 
> This file is being removed, but not replaced. Is it not used anywhere? If
> not, it's fine to remove it (it's a resource, so it is not itself a test)
> 
> > LayoutTests/http/tests/loading/resources/imported-stylesheet-varying-according-domain.css.py:10
> > +color = ''
> 
> You can do this in a one-liner:
> 
> color = 'green' if host == domain else 'red'
> 
> > LayoutTests/http/tests/loading/resources/imported-stylesheet-varying-according-domain.css.py:19
> > +    'body {{ background-color: {};}}'.format(color)
> 
> You may actually consider putting the one-liner as the format argument
> 
> > LayoutTests/http/tests/loading/resources/post-in-iframe-with-back-navigation-page-1.py:6
> > +today = time.time()
> 
> Nit: I'd call this variable "now" since it isn't just the day
> 
> > LayoutTests/http/tests/loading/resources/post-in-iframe-with-back-navigation-page-2.py:6
> > +today = time.time()
> 
> Nit: I'd call this variable "now" since it isn't just the day
> 
> > LayoutTests/http/tests/loading/resources/post-in-iframe-with-back-navigation-page-3.py:6
> > +today = time.time()
> 
> Nit: I'd call this variable "now" since it isn't just the day

Fixed in comment 7
Comment 9 Chris Gambrell 2021-03-01 10:34:53 PST
Created attachment 421842 [details]
Patch
Comment 10 EWS 2021-03-01 13:16:25 PST
Committed r273685: <https://commits.webkit.org/r273685>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421842 [details].
Comment 11 Chris Gambrell 2021-03-31 19:08:59 PDT
Reopening for the second pass
Comment 12 Chris Gambrell 2021-03-31 19:25:39 PDT
Created attachment 424865 [details]
Patch
Comment 13 Chris Gambrell 2021-04-01 19:09:09 PDT
Created attachment 424974 [details]
Patch
Comment 14 Jonathan Bedard 2021-04-02 11:48:53 PDT
Comment on attachment 424974 [details]
Patch

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

> LayoutTests/http/tests/loading/resources/redirect-methods-result.py:24
> +    header_cookies = os.environ['HTTP_COOKIE']

Any reason not to use get_cookies()?
Comment 15 Chris Gambrell 2021-04-02 12:14:09 PDT
Created attachment 425038 [details]
Patch
Comment 16 EWS 2021-04-06 11:00:37 PDT
Committed r275533: <https://commits.webkit.org/r275533>

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