Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 8 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /webcodecs/videoFrame-orientation-imageBitmap.any.html - WPT Dashboard Interop Dashboard
- /webcodecs/videoFrame-orientation-imageBitmap.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,dedicatedworker
// META: script=/webcodecs/videoFrame-orientation-utils.js
runOrientationTests('createImageBitmap()', async (frame, orientation, description) => {
const {width, height} = orientedSize(orientation);
const bitmap = await createImageBitmap(frame);
try {
assert_equals(bitmap.width, width, 'bitmap width');
assert_equals(bitmap.height, height, 'bitmap height');
const ctx = new OffscreenCanvas(width, height).getContext('2d');
ctx.drawImage(bitmap, 0, 0);
verifyOrientedPixels(ctx.getImageData(0, 0, width, height).data, orientation, description);
} finally {
bitmap.close();
}
});