mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 14cfa4d648cc1c853b4153268df672d21425f8c1
This commit is contained in:
parent
1b73cf3352
commit
75736751d9
1213 changed files with 19434 additions and 12344 deletions
31
tests/wpt/web-platform-tests/fetch/api/basic/keepalive.html
Normal file
31
tests/wpt/web-platform-tests/fetch/api/basic/keepalive.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>Fetch API: keepalive handling</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const host_info = get_host_info();
|
||||
promise_test(async (test) => {
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.src = host_info.HTTP_REMOTE_ORIGIN +
|
||||
'/fetch/api/resources/keepalive-iframe.html';
|
||||
document.body.appendChild(iframe);
|
||||
const uuid_promise = new Promise((resolve) => {
|
||||
window.addEventListener('message', (event) => {
|
||||
resolve(event.data);
|
||||
});
|
||||
});
|
||||
await (new Promise((resolve) => iframe.addEventListener('load', resolve)));
|
||||
const uuid = await uuid_promise;
|
||||
iframe.remove();
|
||||
await (new Promise((resolve) => test.step_timeout(resolve, 1000)));
|
||||
const response = await fetch(`../resources/stash-take.py?key=${uuid}`);
|
||||
const json = await response.json();
|
||||
assert_equals(json, 'on');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue