[webkit-reviews] review granted: [Bug 223234] [LayoutTests] Convert http/tests/referrer-policy convert PHP to Python : [Attachment 424819] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 1 08:35:07 PDT 2021


Jonathan Bedard <jbedard at apple.com> has granted Chris Gambrell
<cgambrell at apple.com>'s request for review:
Bug 223234: [LayoutTests] Convert http/tests/referrer-policy convert PHP to
Python
https://bugs.webkit.org/show_bug.cgi?id=223234

Attachment 424819: Patch

https://bugs.webkit.org/attachment.cgi?id=424819&action=review




--- Comment #7 from Jonathan Bedard <jbedard at apple.com> ---
Comment on attachment 424819
  --> https://bugs.webkit.org/attachment.cgi?id=424819
Patch

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

> LayoutTests/http/tests/css/resources/webfont-request.py:9
> +http_root =
os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(file))))

I don't see us using this path

> LayoutTests/http/tests/referrer-policy/resources/image.py:17
> +with open(os.path.join('/'.join(__file__.split('/')[0:-1]),
'../../security/contentSecurityPolicy/block-all-mixed-content/resources/red-squ
are.png'), 'rb') as file:

Should use os.path.abspath(...) after os.path.join(...)

>
LayoutTests/http/tests/websocket/tests/hybi/contentextensions/block-cookies-wor
ker.py.json:16
> +]''')

I would do this instead:
print(json.dumps([{
    'action': {'type': 'block-cookies'},
    'trigger': {'url-filter': '8880'},
}], indent=4)

That way you don't have to worry about encoding JSON correctly

>
LayoutTests/http/tests/websocket/tests/hybi/contentextensions/block-cookies.py.
json:16
> +]''')

Ditto on manually encoding json


More information about the webkit-reviews mailing list