Update web-platform-tests to revision 3bfdeb8976fc51748935c8d1f1014dfba8e08dfb

This commit is contained in:
WPT Sync Bot 2019-03-28 22:09:18 -04:00
parent fcd6beb608
commit cb63cfd5c7
185 changed files with 3083 additions and 1074 deletions

View file

@ -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());
}