mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 3bfdeb8976fc51748935c8d1f1014dfba8e08dfb
This commit is contained in:
parent
fcd6beb608
commit
cb63cfd5c7
185 changed files with 3083 additions and 1074 deletions
|
@ -55,26 +55,29 @@ function testImmediateUpdate({ textContent: testName }) {
|
|||
const eventPromise = new Promise((resolve, reject) => {
|
||||
request.addEventListener(
|
||||
"shippingaddresschange",
|
||||
async ev => {
|
||||
// spin the event loop, sets [[waitForUpdate]] to true.
|
||||
await Promise.resolve();
|
||||
try {
|
||||
ev.updateWith(validDetails);
|
||||
resolve(); // This is bad.
|
||||
} catch (err) {
|
||||
reject(err); // this is good.
|
||||
}
|
||||
ev => {
|
||||
// Forces updateWith() to be run in the next event loop tick so that
|
||||
// [[waitForUpdate]] is already true when it runs.
|
||||
t.step_timeout(() => {
|
||||
try {
|
||||
ev.updateWith(validDetails);
|
||||
resolve(); // This is bad.
|
||||
} catch (err) {
|
||||
reject(err); // this is good.
|
||||
}
|
||||
});
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
});
|
||||
const response = await request.show();
|
||||
const acceptPromise = request.show();
|
||||
await promise_rejects(
|
||||
t,
|
||||
"InvalidStateError",
|
||||
eventPromise,
|
||||
"The event loop already spun, so [[waitForUpdate]] is now true"
|
||||
);
|
||||
const response = await acceptPromise;
|
||||
await response.complete();
|
||||
}, testName.trim());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue