-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69cfd97
commit 256347a
Showing
295 changed files
with
17,510 additions
and
840 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file modified
0
test/fixtures/wpt/common/security-features/tools/spec_validator.py
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/fixtures/wpt/fetch/api/response/response-blob-realm.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// META: global=window | ||
// META: title=realm of Response bytes() | ||
|
||
"use strict"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 17 additions & 14 deletions
31
test/fixtures/wpt/fetch/compression-dictionary/resources/compressed-data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
def main(request, response): | ||
response.headers.set(b"Access-Control-Allow-Origin", b"*") | ||
response.headers.set(b"Content-Type", b"text/plain") | ||
response.headers.set( | ||
b"Content-Dictionary", | ||
b":U5abz16WDg7b8KS93msLPpOB4Vbef1uRzoORYkJw9BY=:") | ||
|
||
# `br_d_data` and `zstd_d_data` are generated using the following commands: | ||
# `dcb_data` and `dcz_data` are generated using the following commands: | ||
# | ||
# $ echo "This is a test dictionary." > /tmp/dict | ||
# $ echo -n "This is compressed test data using a test dictionary" \ | ||
# > /tmp/data | ||
# $ brotli -o /tmp/out.brd -D /tmp/dict /tmp/data | ||
# $ xxd -p /tmp/out.brd | tr -d '\n' | sed 's/\(..\)/\\x\1/g' | ||
br_d_data = b"\xa1\x98\x01\x80\x62\xa4\x4c\x1d\xdf\x12\x84\x8c\xae\xc2\xca\x60\x22\x07\x6e\x81\x05\x14\xc9\xb7\xc3\x44\x8e\xbc\x16\xe0\x15\x0e\xec\xc1\xee\x34\x33\x3e\x0d" | ||
# $ zstd -o /tmp/out.zstdd -D /tmp/dict /tmp/data | ||
# $ xxd -p /tmp/out.zstdd | tr -d '\n' | sed 's/\(..\)/\\x\1/g' | ||
zstd_d_data = b"\x28\xb5\x2f\xfd\x24\x34\xf5\x00\x00\x98\x63\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x61\x74\x61\x20\x75\x73\x69\x6e\x67\x03\x00\x59\xf9\x73\x54\x46\x27\x26\x10\x9e\x99\xf2\xbc" | ||
# | ||
# $ echo -en '\xffDCB' > /tmp/out.dcb | ||
# $ openssl dgst -sha256 -binary /tmp/dict >> /tmp/out.dcb | ||
# $ brotli --stdout -D /tmp/dict /tmp/data >> /tmp/out.dcb | ||
# $ xxd -p /tmp/out.dcb | tr -d '\n' | sed 's/\(..\)/\\x\1/g' | ||
dcb_data = b"\xff\x44\x43\x42\x53\x96\x9b\xcf\x5e\x96\x0e\x0e\xdb\xf0\xa4\xbd\xde\x6b\x0b\x3e\x93\x81\xe1\x56\xde\x7f\x5b\x91\xce\x83\x91\x62\x42\x70\xf4\x16\xa1\x98\x01\x80\x62\xa4\x4c\x1d\xdf\x12\x84\x8c\xae\xc2\xca\x60\x22\x07\x6e\x81\x05\x14\xc9\xb7\xc3\x44\x8e\xbc\x16\xe0\x15\x0e\xec\xc1\xee\x34\x33\x3e\x0d" | ||
# $ echo -en '\x5e\x2a\x4d\x18\x20\x00\x00\x00' > /tmp/out.dcz | ||
# $ openssl dgst -sha256 -binary /tmp/dict >> /tmp/out.dcz | ||
# $ zstd -D /tmp/dict -f -o /tmp/tmp.zstd /tmp/data | ||
# $ cat /tmp/tmp.zstd >> /tmp/out.dcz | ||
# $ xxd -p /tmp/out.dcz | tr -d '\n' | sed 's/\(..\)/\\x\1/g' | ||
dcz_data = b"\x5e\x2a\x4d\x18\x20\x00\x00\x00\x53\x96\x9b\xcf\x5e\x96\x0e\x0e\xdb\xf0\xa4\xbd\xde\x6b\x0b\x3e\x93\x81\xe1\x56\xde\x7f\x5b\x91\xce\x83\x91\x62\x42\x70\xf4\x16\x28\xb5\x2f\xfd\x24\x34\xf5\x00\x00\x98\x63\x6f\x6d\x70\x72\x65\x73\x73\x65\x64\x61\x74\x61\x20\x75\x73\x69\x6e\x67\x03\x00\x59\xf9\x73\x54\x46\x27\x26\x10\x9e\x99\xf2\xbc" | ||
|
||
if b'content_encoding' in request.GET: | ||
content_encoding = request.GET.first(b"content_encoding") | ||
response.headers.set(b"Content-Encoding", content_encoding) | ||
if content_encoding == b"br-d": | ||
if content_encoding == b"dcb": | ||
# Send the pre compressed file | ||
response.content = br_d_data | ||
if content_encoding == b"zstd-d": | ||
response.content = dcb_data | ||
if content_encoding == b"dcz": | ||
# Send the pre compressed file | ||
response.content = zstd_d_data | ||
response.content = dcz_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# FetchLater Tests | ||
|
||
These tests cover [FetchLater method](https://whatpr.org/fetch/1647/094ea69...152d725.html#fetch-later-method) related behaviors. | ||
These tests cover [FetchLater method](https://whatpr.org/fetch/1647.html#dom-window-fetchlater) related behaviors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
test/fixtures/wpt/fetch/fetch-later/permissions-policy/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Permissions Policy: "deferred-fetch" Tests | ||
|
||
This folder contains tests to cover the permissions policy "deferred-fetch", | ||
which is used to gate the `fetchLater()` API. | ||
|
||
The tests follow the patterns from | ||
permissions-policy/README.md to cover all use cases of permissions policy for a | ||
new feature. |
31 changes: 31 additions & 0 deletions
31
...deferred-fetch-allowed-by-permissions-policy-attribute-redirect.tentative.https.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// META: title=Permissions Policy "deferred-fetch" is allowed to redirect by allow attribute | ||
// META: script=/permissions-policy/resources/permissions-policy.js | ||
// META: script=/common/utils.js | ||
// META: script=/common/get-host-info.sub.js | ||
// META: script=/fetch/fetch-later/resources/fetch-later-helper.js | ||
// META: script=/fetch/fetch-later/permissions-policy/resources/helper.js | ||
// META: timeout=long | ||
'use strict'; | ||
|
||
const { | ||
HTTPS_ORIGIN, | ||
HTTPS_NOTSAMESITE_ORIGIN, | ||
} = get_host_info(); | ||
|
||
const baseUrl = '/permissions-policy/resources/redirect-on-load.html#'; | ||
const description = 'Permissions policy allow="deferred-fetch"'; | ||
|
||
async_test(t => { | ||
test_feature_availability( | ||
'fetchLater()', t, | ||
getDeferredFetchPolicyInIframeHelperUrl(`${baseUrl}${HTTPS_ORIGIN}`), | ||
expect_feature_available_default, /*feature_name=*/ 'deferred-fetch'); | ||
}, `${description} allows same-origin navigation in an iframe.`); | ||
|
||
async_test(t => { | ||
test_feature_availability( | ||
'fetchLater()', t, | ||
getDeferredFetchPolicyInIframeHelperUrl( | ||
`${baseUrl}${HTTPS_NOTSAMESITE_ORIGIN}`), | ||
expect_feature_unavailable_default, /*feature_name=*/ 'deferred-fetch'); | ||
}, `${description} disallows cross-origin navigation in an iframe.`); |
36 changes: 36 additions & 0 deletions
36
...s-policy/deferred-fetch-allowed-by-permissions-policy-attribute.tentative.https.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// META: title=Permissions Policy "deferred-fetch" is allowed by allow attribute | ||
// META: script=/permissions-policy/resources/permissions-policy.js | ||
// META: script=/common/utils.js | ||
// META: script=/common/get-host-info.sub.js | ||
// META: script=/fetch/fetch-later/resources/fetch-later-helper.js | ||
// META: script=/fetch/fetch-later/permissions-policy/resources/helper.js | ||
// META: timeout=long | ||
'use strict'; | ||
|
||
const { | ||
HTTPS_ORIGIN, | ||
HTTPS_NOTSAMESITE_ORIGIN, | ||
} = get_host_info(); | ||
|
||
const description = 'Permissions policy "deferred-fetch"'; | ||
const attribute = 'allow="deferred-fetch" attribute'; | ||
|
||
async_test( | ||
t => { | ||
test_feature_availability( | ||
'fetchLater()', t, | ||
getDeferredFetchPolicyInIframeHelperUrl(HTTPS_ORIGIN), | ||
expect_feature_available_default, /*feature_name=*/ 'deferred-fetch'); | ||
}, | ||
`${description} can be enabled in the same-origin iframe using ${ | ||
attribute}.`); | ||
|
||
async_test( | ||
t => { | ||
test_feature_availability( | ||
'fetchLater()', t, | ||
getDeferredFetchPolicyInIframeHelperUrl(HTTPS_NOTSAMESITE_ORIGIN), | ||
expect_feature_available_default, /*feature_name=*/ 'deferred-fetch'); | ||
}, | ||
`${description} can be enabled in the cross-origin iframe using ${ | ||
attribute}.`); |
Oops, something went wrong.