mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Implement initial version of navigator.sendBeacon
(#38301)
Gated behind the feature flag `dom_navigator_sendbeacon_enabled` as the `keep-alive` fetch parameter is crucial for real-life use cases such as analytics requests. Part of #4577 Part of #38302 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
181f97879d
commit
dbb886fad2
22 changed files with 237 additions and 29 deletions
2
tests/wpt/include.ini
vendored
2
tests/wpt/include.ini
vendored
|
@ -3,6 +3,8 @@ skip: true
|
|||
skip: false
|
||||
[_webgl]
|
||||
skip: false
|
||||
[beacon]
|
||||
skip: false
|
||||
[clipboard-apis]
|
||||
skip: false
|
||||
[console]
|
||||
|
|
12
tests/wpt/meta/beacon/beacon-basic.https.window.js.ini
vendored
Normal file
12
tests/wpt/meta/beacon/beacon-basic.https.window.js.ini
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
[beacon-basic.https.window.html]
|
||||
[Payload size restriction should be accumulated: type = string]
|
||||
expected: FAIL
|
||||
|
||||
[Payload size restriction should be accumulated: type = arraybuffer]
|
||||
expected: FAIL
|
||||
|
||||
[Payload size restriction should be accumulated: type = blob]
|
||||
expected: FAIL
|
||||
|
||||
[sendBeacon() with a stream does not work due to the keepalive flag being set]
|
||||
expected: FAIL
|
6
tests/wpt/meta/beacon/beacon-cors.https.window.js.ini
vendored
Normal file
6
tests/wpt/meta/beacon/beacon-cors.https.window.js.ini
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[beacon-cors.https.window.html]
|
||||
[cross-origin, non-CORS-safelisted: failure case (without redirect)]
|
||||
expected: FAIL
|
||||
|
||||
[cross-origin, non-CORS-safelisted[credentials=false\]]
|
||||
expected: FAIL
|
4
tests/wpt/meta/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html.ini
vendored
Normal file
4
tests/wpt/meta/beacon/headers/header-referrer-no-referrer-when-downgrade.https.html.ini
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[header-referrer-no-referrer-when-downgrade.https.html]
|
||||
expected: TIMEOUT
|
||||
[Test referer header http://web-platform.test:8000/beacon/resources/]
|
||||
expected: TIMEOUT
|
4
tests/wpt/meta/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html.ini
vendored
Normal file
4
tests/wpt/meta/beacon/headers/header-referrer-strict-origin-when-cross-origin.https.html.ini
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[header-referrer-strict-origin-when-cross-origin.https.html]
|
||||
expected: TIMEOUT
|
||||
[Test referer header http://www1.web-platform.test:8000/beacon/resources/]
|
||||
expected: TIMEOUT
|
4
tests/wpt/meta/beacon/headers/header-referrer-strict-origin.https.html.ini
vendored
Normal file
4
tests/wpt/meta/beacon/headers/header-referrer-strict-origin.https.html.ini
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[header-referrer-strict-origin.https.html]
|
||||
expected: TIMEOUT
|
||||
[Test referer header http://web-platform.test:8000/beacon/resources/]
|
||||
expected: TIMEOUT
|
4
tests/wpt/meta/beacon/headers/header-referrer-unsafe-url.https.html.ini
vendored
Normal file
4
tests/wpt/meta/beacon/headers/header-referrer-unsafe-url.https.html.ini
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[header-referrer-unsafe-url.https.html]
|
||||
expected: TIMEOUT
|
||||
[Test referer header http://web-platform.test:8000/beacon/resources/]
|
||||
expected: TIMEOUT
|
|
@ -1,3 +0,0 @@
|
|||
[connect-src-beacon-allowed.sub.html]
|
||||
[Expecting logs: ["Pass"\]]
|
||||
expected: NOTRUN
|
|
@ -1,3 +0,0 @@
|
|||
[connect-src-beacon-blocked.sub.html]
|
||||
[Expecting logs: ["Pass", "violated-directive=connect-src"\]]
|
||||
expected: NOTRUN
|
|
@ -1,3 +0,0 @@
|
|||
[connect-src-beacon-redirect-to-blocked.sub.html]
|
||||
[Expecting logs: ["violated-directive=connect-src"\]]
|
||||
expected: NOTRUN
|
|
@ -14,9 +14,6 @@
|
|||
[source : unpaired surrogate codepoint should be replaced with U+FFFD]
|
||||
expected: FAIL
|
||||
|
||||
[sendBeacon URL: unpaired surrogate codepoint should not make any exceptions.]
|
||||
expected: FAIL
|
||||
|
||||
[RegisterProtocolHandler URL: unpaired surrogate codepoint should not make any exceptions.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[beacon.https.html]
|
||||
[Mixed-Content: Expects allowed for beacon to same-https origin and keep-scheme redirection from https context.]
|
||||
[Mixed-Content: Expects blocked for beacon to cross-https origin and swap-scheme redirection from https context.]
|
||||
expected: FAIL
|
||||
|
||||
[Mixed-Content: Expects allowed for beacon to same-https origin and no-redirect redirection from https context.]
|
||||
[Mixed-Content: Expects blocked for beacon to same-https origin and swap-scheme redirection from https context.]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[beacon.https.html]
|
||||
[Mixed-Content: Expects allowed for beacon to same-https origin and no-redirect redirection from https context.]
|
||||
expected: FAIL
|
|
@ -1,6 +0,0 @@
|
|||
[beacon.https.html]
|
||||
[Mixed-Content: Expects allowed for beacon to same-https origin and keep-scheme redirection from https context.]
|
||||
expected: FAIL
|
||||
|
||||
[Mixed-Content: Expects allowed for beacon to same-https origin and no-redirect redirection from https context.]
|
||||
expected: FAIL
|
|
@ -1,2 +1,16 @@
|
|||
[misc.html]
|
||||
expected: ERROR
|
||||
expected: TIMEOUT
|
||||
[The initiator type for <body background> must be 'body']
|
||||
expected: FAIL
|
||||
|
||||
[The initiator type for <input type='image'> must be 'input']
|
||||
expected: FAIL
|
||||
|
||||
[The initiator type for <object type='image/png'> must be 'object']
|
||||
expected: FAIL
|
||||
|
||||
[The initiator type for for fetch() must be 'fetch']
|
||||
expected: FAIL
|
||||
|
||||
[The initiator type for new EventSource() must be 'other']
|
||||
expected: TIMEOUT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue