blob: 80ad9481c1503fb9bedee1d69861745ceaba17e1 [file] [log] [blame]
Test OffscreenCanvas transferable with exception cases.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS ctx = offscreenCanvas1.getContext('2d') did not throw exception.
PASS ctx is an instance of OffscreenCanvasRenderingContext2D
PASS worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas with a context could not be cloned..
PASS offscreenCanvas2.transferToImageBitmap() threw exception InvalidStateError: Failed to execute 'transferToImageBitmap' on 'OffscreenCanvas': Cannot transfer an ImageBitmap from a detached OffscreenCanvas.
PASS worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]) threw exception DataCloneError: Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas is detached and could not be cloned..
PASS offscreenCanvas2.getContext('2d') threw exception InvalidStateError: Failed to execute 'getContext' on 'OffscreenCanvas': OffscreenCanvas object is detached.
PASS ctx.drawImage(offscreenCanvas2, 0, 0) threw exception InvalidStateError: Failed to execute 'drawImage' on 'OffscreenCanvasRenderingContext2D': The image source is detached.
PASS successfullyParsed is true
TEST COMPLETE