OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <script> | 3 <script> |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 window.testRunner.waitUntilDone(); | 5 window.testRunner.waitUntilDone(); |
6 | 6 |
7 function shouldNotBeCalled() { | 7 function shouldNotBeCalled() { |
8 testFailed("Promise was rejected."); | 8 testFailed("Promise was rejected."); |
9 finishJSTest(); | 9 finishJSTest(); |
10 } | 10 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 var imageBitmaps = {}; | 67 var imageBitmaps = {}; |
68 | 68 |
69 function callback(name) { | 69 function callback(name) { |
70 var name = name; | 70 var name = name; |
71 return function(imageBitmap) { | 71 return function(imageBitmap) { |
72 switch(name) { | 72 switch(name) { |
73 case 'Image': | 73 case 'Image': |
74 imageBitmaps.image = imageBitmap; | 74 imageBitmaps.image = imageBitmap; |
75 image.onload = function() { | 75 image.onload = function() { |
76 ctx.drawImage(imageBitmaps.image, 0, 0); | 76 ctx.drawImage(imageBitmaps.image, 0, 0); |
| 77 createImageBitmap(imageBitmaps.image).then(callback('ImageBitmap
Image')); |
77 checkIfDone(); | 78 checkIfDone(); |
78 }; | 79 }; |
79 image.src = bCanvas.toDataURL(); | 80 image.src = bCanvas.toDataURL(); |
80 createImageBitmap(imageBitmaps.image).then(callback('ImageBitmapImag
e')); | |
81 break; | 81 break; |
82 case 'Data': | 82 case 'Data': |
83 imageBitmaps.data = imageBitmap; | 83 imageBitmaps.data = imageBitmap; |
84 d = 0; | 84 d = 0; |
85 ctx.drawImage(imageBitmaps.data, 11, 0); | 85 ctx.drawImage(imageBitmaps.data, 11, 0); |
86 createImageBitmap(imageBitmaps.data).then(callback('ImageBitmapData'
)); | 86 createImageBitmap(imageBitmaps.data).then(callback('ImageBitmapData'
)); |
87 checkIfDone(); | 87 checkIfDone(); |
88 break; | 88 break; |
89 case 'Canvas': | 89 case 'Canvas': |
90 imageBitmaps.canvas = imageBitmap; | 90 imageBitmaps.canvas = imageBitmap; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 var checkNum = 0; | 130 var checkNum = 0; |
131 function checkIfDone() { | 131 function checkIfDone() { |
132 if (++checkNum == 8 && window.testRunner) | 132 if (++checkNum == 8 && window.testRunner) |
133 window.testRunner.notifyDone(); | 133 window.testRunner.notifyDone(); |
134 } | 134 } |
135 | 135 |
136 </script> | 136 </script> |
137 <p>There should be 8 green squares displayed in a 2 row by 4 column grid.</p> | 137 <p>There should be 8 green squares displayed in a 2 row by 4 column grid.</p> |
138 </body> | 138 </body> |
139 </html> | 139 </html> |
OLD | NEW |