By defining the version of the "globals" module at the top-level, we can ensure that we get the expected version of the modules in our ESLint configuration. This also means that we can pick up new globals without having to wait for dependencies to pick up the new version of the "globals" module. This also fixes the raised issues when moving across to the updated globals modules, as well as removing a couple of exclusions that are now no longer necessary. Differential Revision: https://phabricator.services.mozilla.com/D300082
55 lines
1.4 KiB
HTML
55 lines
1.4 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title></title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
</head>
|
|
<body>
|
|
<script>
|
|
async function test(desiredWidth, desiredHeight, expectedWidth, expectedHeight) {
|
|
const imgResponse = await fetch("green.png");
|
|
const decoder = new ImageDecoder({
|
|
data: imgResponse.body,
|
|
type: "image/png",
|
|
desiredWidth,
|
|
desiredHeight,
|
|
});
|
|
|
|
// Should download all the data and decode metadata just fine.
|
|
await decoder.completed;
|
|
await decoder.tracks.ready;
|
|
is(decoder.tracks.length, 1, "Should have one track");
|
|
is(decoder.tracks[0].frameCount, 1, "Should have a single frame");
|
|
|
|
try {
|
|
const result = await decoder.decode();
|
|
ok(result.complete, "Should have complete image");
|
|
is(result.image.codedWidth, expectedWidth, "Should have expected width");
|
|
is(result.image.codedHeight, expectedHeight, "Should have expected height");
|
|
} catch (e) {
|
|
ok(false, "Decode image failed with " + e)
|
|
}
|
|
|
|
return Promise.resolve();
|
|
}
|
|
|
|
async function initTest() {
|
|
SimpleTest.waitForExplicitFinish();
|
|
try {
|
|
await test(10, 20, 10, 20);
|
|
await test(100, 300, 100, 100);
|
|
await test(500, 40, 100, 100);
|
|
await test(500, 300, 100, 100);
|
|
} catch (e) {
|
|
ok(false, "Unexpected error " + e);
|
|
} finally {
|
|
SimpleTest.finish();
|
|
}
|
|
}
|
|
|
|
initTest();
|
|
</script>
|
|
</body>
|
|
</html>
|