| 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 description("Ensure correct behavior of createImageBitmap for invalid inputs."); | 8 description("Ensure correct behavior of createImageBitmap for invalid inputs."); |
| 9 window.jsTestIsAsync = true; | 9 window.jsTestIsAsync = true; |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 }).then(function() { | 96 }).then(function() { |
| 97 return createVideo().then(function(video) { | 97 return createVideo().then(function(video) { |
| 98 return checkInvalidRange(video, 'video'); | 98 return checkInvalidRange(video, 'video'); |
| 99 }); | 99 }); |
| 100 }).then(function() { | 100 }).then(function() { |
| 101 return createCanvas().then(function(canvas) { | 101 return createCanvas().then(function(canvas) { |
| 102 return checkInvalidRange(canvas, 'canvas'); | 102 return checkInvalidRange(canvas, 'canvas'); |
| 103 }); | 103 }); |
| 104 }).then(function() { | 104 }).then(function() { |
| 105 return createCanvas().then(function(canvas) { | 105 return createCanvas().then(function(canvas) { |
| 106 return checkInvalidRange(canvas.getContext('2d'), 'canvas context'); | |
| 107 }); | |
| 108 }).then(function() { | |
| 109 return createCanvas().then(function(canvas) { | |
| 110 var imagedata = canvas.getContext('2d').getImageData(0, 0, canvas.width,
canvas.height); | 106 var imagedata = canvas.getContext('2d').getImageData(0, 0, canvas.width,
canvas.height); |
| 111 return checkInvalidRange(imagedata, 'canvas imagedata') | 107 return checkInvalidRange(imagedata, 'canvas imagedata') |
| 112 }); | 108 }); |
| 113 }).then(function() { | 109 }).then(function() { |
| 114 return createImage().then(function(image) { | 110 return createImage().then(function(image) { |
| 115 return createImageBitmap(image); | 111 return createImageBitmap(image); |
| 116 }).then(function(bitmap) { | 112 }).then(function(bitmap) { |
| 117 return checkInvalidRange(bitmap, 'image bitmap'); | 113 return checkInvalidRange(bitmap, 'image bitmap'); |
| 118 }); | 114 }); |
| 119 }).then(function() { | 115 }).then(function() { |
| 120 return createBlob('resources/pattern.png').then(function(blob) { | 116 return createBlob('resources/pattern.png').then(function(blob) { |
| 121 return checkInvalidRange(blob, 'blob'); | 117 return checkInvalidRange(blob, 'blob'); |
| 122 }); | 118 }); |
| 123 }).then(function() { | 119 }).then(function() { |
| 124 return createBlob('resources/shadow-offset.js').then(function(blob) { | 120 return createBlob('resources/shadow-offset.js').then(function(blob) { |
| 125 return shouldBeRejected(createImageBitmap(blob), 'invalid blob'); | 121 return shouldBeRejected(createImageBitmap(blob), 'invalid blob'); |
| 126 }); | 122 }); |
| 127 }).then(function() { | 123 }).then(function() { |
| 128 return createInvalidCanvas().then(function(invalidCanvas) { | 124 return createInvalidCanvas().then(function(invalidCanvas) { |
| 129 return shouldBeRejected(createImageBitmap(invalidCanvas), 'invalid canva
s'); | 125 return shouldBeRejected(createImageBitmap(invalidCanvas), 'invalid canva
s'); |
| 130 }); | 126 }); |
| 131 }).catch(function(e) { | 127 }).catch(function(e) { |
| 132 testFailed('Unexpected rejection: ' + e); | 128 testFailed('Unexpected rejection: ' + e); |
| 133 }).then(finishJSTest, finishJSTest); | 129 }).then(finishJSTest, finishJSTest); |
| 134 | 130 |
| 135 </script> | 131 </script> |
| 136 </body> | 132 </body> |
| 137 </html> | 133 </html> |
| OLD | NEW |