{"ScriptPreparationCode":"var img = new window.Image()\r\nvar imageBitmap\r\n\r\nconst canvas = document.createElement(\u0027canvas\u0027)\r\ncanvas.width = 640\r\ncanvas.height = 480\r\n\r\nvar ctx = canvas.getContext(\u00272d\u0027)\r\nvar promise = new Promise(resolve =\u003E {\r\n img.addEventListener(\u0027load\u0027, function() {\r\n window.createImageBitmap(img)\r\n .then(function(bitmap) {\r\n imageBitmap = bitmap\r\n resolve()\r\n })\r\n })\r\n})\r\n\r\nimg.src = \u0027https://1.bp.blogspot.com/-52MtzD0GfX0/WvP52CL1WjI/AAAAAAAAOVw/_OpK4JHeWK01d-7IiZ6vzojYGhXqLRXrACLcBGAs/s1600/EMxediL.jpg\u0027;","TestCases":[{"Name":"Image","Code":"promise.then(()=\u003E ctx.drawImage(img, 0, 0));","IsDeferred":false},{"Name":"Bitmap","Code":"promise.then(()=\u003E ctx.drawImage(imageBitmap, 0, 0));","IsDeferred":false}]}