let lostPromise;
// Create a scope with a device that will go out of scope
// and then be dropped.
{
const device = await adapter.requestDevice();
ok(device !== undefined, "device !== undefined");
// Create a new promise that will resolve when the original
// lost promise resolves or rejects, either of which will be
// noted as an error.
lostPromise = device.lost.then(
resolve => {
ok(false, "device.lost should never resolve");
resolve("unexpected resolve");
},
reject => {
ok(false, "device.lost should never reject");
reject("unexpected reject");
}
);
}
// Give a chance (one event cycle) for the lostPromise to resolve or
// reject, but don't wait for any specific amount of time.
await new Promise(SimpleTest.executeSoon);
info("drop_causes_lost_is_unobservable END");
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.