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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, testBitmap, blob]; | 156 elements = [image, aCanvas, d, testBitmap, blob]; |
157 | |
158 // wait for callback to finish before each check to ensure synchronous b
ehavior | 157 // wait for callback to finish before each check to ensure synchronous b
ehavior |
159 nextCheck(0); | 158 nextCheck(0); |
160 } | 159 } |
161 } | 160 } |
162 | 161 |
163 function nextCheck(elementIndex) { | 162 function nextCheck(elementIndex) { |
164 if (elementIndex == elements.length) { | 163 if (elementIndex == elements.length) { |
165 finishJSTest(); | 164 finishJSTest(); |
166 return; | 165 return; |
167 } | 166 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 clearContext(ctx); | 402 clearContext(ctx); |
404 ctx.drawImage(imageBitmap, 0, 0); | 403 ctx.drawImage(imageBitmap, 0, 0); |
405 shouldBeClear(1, 1); | 404 shouldBeClear(1, 1); |
406 shouldBeClear(9, 9); | 405 shouldBeClear(9, 9); |
407 shouldBeClear(11, 11); | 406 shouldBeClear(11, 11); |
408 shouldBeClear(22, 22); | 407 shouldBeClear(22, 22); |
409 } | 408 } |
410 </script> | 409 </script> |
411 </body> | 410 </body> |
412 </html> | 411 </html> |
OLD | NEW |