// The first two tests here are redundant with the CTS test
// webgpu:web_platform,canvas,configure:device:*, but when
// they were added, that CTS test had additional checks that
// were still failing.
let expectedError;
try {
context.configure({});
} catch (error) {
expectedError = error;
}
is(
expectedError?.name, "TypeError", "Canvas configure without a device should generate a TypeError."
);
expectedError = undefined;
try {
context.getCurrentTexture();
} catch (error) {
expectedError = error;
}
is(
expectedError?.name, "InvalidStateError", "getCurrentTexture on unconfigured canvas should generate an InvalidStateError."
);
// Attempt to configure with a too-large canvas, which should
// fail due to device texture limits. canvas.width = 1970696937;
expectedError = undefined;
try {
context.configure({
device,
format,
});
} catch (error) {
expectedError = error;
}
// Bug 1967833: This should become an "is". Or possibly it
// should expect a validation error (asynchronously) instead.
todo_is(
expectedError?.name, "TypeError", "Failed configure should generate a TypeError."
);
}
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.