| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 description("Ensure correct behavior of drawImage with ImageBitmaps."); | 9 description("Ensure correct behavior of drawImage with ImageBitmaps."); |
| 10 window.jsTestIsAsync = true; | 10 window.jsTestIsAsync = true; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 xhr.send(); | 146 xhr.send(); |
| 147 xhr.onload = function() { | 147 xhr.onload = function() { |
| 148 blob = xhr.response; | 148 blob = xhr.response; |
| 149 blobLoaded = true; | 149 blobLoaded = true; |
| 150 loaded(); | 150 loaded(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 function loaded() { | 153 function loaded() { |
| 154 if (imageLoaded && imageBitmapLoaded && blobLoaded) { | 154 if (imageLoaded && imageBitmapLoaded && blobLoaded) { |
| 155 // check all of these elements | 155 // check all of these elements |
| 156 elements = [image, aCanvas, d, aCtx, testBitmap, blob]; | 156 elements = [image, aCanvas, d, testBitmap, blob]; |
| 157 | 157 |
| 158 // wait for callback to finish before each check to ensure synchronous b
ehavior | 158 // wait for callback to finish before each check to ensure synchronous b
ehavior |
| 159 nextCheck(0); | 159 nextCheck(0); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 function nextCheck(elementIndex) { | 163 function nextCheck(elementIndex) { |
| 164 if (elementIndex == elements.length) { | 164 if (elementIndex == elements.length) { |
| 165 finishJSTest(); | 165 finishJSTest(); |
| 166 return; | 166 return; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 clearContext(ctx); | 403 clearContext(ctx); |
| 404 ctx.drawImage(imageBitmap, 0, 0); | 404 ctx.drawImage(imageBitmap, 0, 0); |
| 405 shouldBeClear(1, 1); | 405 shouldBeClear(1, 1); |
| 406 shouldBeClear(9, 9); | 406 shouldBeClear(9, 9); |
| 407 shouldBeClear(11, 11); | 407 shouldBeClear(11, 11); |
| 408 shouldBeClear(22, 22); | 408 shouldBeClear(22, 22); |
| 409 } | 409 } |
| 410 </script> | 410 </script> |
| 411 </body> | 411 </body> |
| 412 </html> | 412 </html> |
| OLD | NEW |