Update web-platform-tests to revision b'02400d32d48521baa38663fe8601779994fcfb78'

This commit is contained in:
WPT Sync Bot 2023-05-21 01:35:12 +00:00
parent bc8cea2495
commit f0bb7a6f9c
483 changed files with 12767 additions and 2644 deletions

View file

@ -566,7 +566,7 @@ test(() => {
controller.abort();
assert_array_equals(log, ['clone-aborted', 'original-aborted'], "Abort events fired in correct order");
assert_array_equals(log, ['original-aborted', 'clone-aborted'], "Abort events fired in correct order");
assert_true(request.signal.aborted, 'Signal aborted');
assert_true(clonedRequest.signal.aborted, 'Signal aborted');
}, "Clone aborts with original controller");

View file

@ -35,9 +35,7 @@ promise_test(function() {
// The fulfill handler above shouldn't have run yet. If it has run,
// throw to reject this promise and fail the test.
if (executed) {
throw "shouldn't have run microtasks yet";
}
assert_false(executed, "shouldn't have run microtasks yet");
// Otherwise act as if there's no "then" property so the promise
// fulfills and the test passes.
@ -49,6 +47,40 @@ promise_test(function() {
return response.body.getReader().read();
});
}, "reading from a body stream should occur in a microtask scope");
promise_test(function() {
return fetch("../resources/data.json").then(function(response) {
// Add a getter for "then" that will incidentally be invoked
// during promise resolution.
Object.prototype.__defineGetter__('then', () => {
// Clean up behind ourselves.
delete Object.prototype.then;
// This promise should (like all promises) be resolved
// asynchronously.
var executed = false;
Promise.resolve().then(_ => { executed = true; });
// This shouldn't run microtasks! They should only run
// after the fetch is resolved.
performMicrotaskCheckpoint();
// The fulfill handler above shouldn't have run yet. If it has run,
// throw to reject this promise and fail the test.
assert_false(executed, "shouldn't have run microtasks yet");
// Otherwise act as if there's no "then" property so the promise
// fulfills and the test passes.
return undefined;
});
// Create a read request, incidentally resolving a promise with an
// object value, thereby invoking the getter installed above.
return response.body.pipeTo(new WritableStream({
write(chunk) {}
}))
});
}, "piping from a body stream to a JS-written WritableStream should occur in a microtask scope");
</script>
</body>
</html>