toBlob.png.html (594B)
1 <!DOCTYPE html> 2 <title>Canvas test: toBlob.png</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id="log"></div> 6 <canvas id="c"></canvas> 7 <script> 8 async_test(function() { 9 on_event(window, "load", this.step_func(function() { 10 var canvas = document.getElementById('c'); 11 var ctx = canvas.getContext('2d'); 12 canvas.toBlob(this.step_func_done(function(data) { 13 assert_equals(data.type, "image/png"); 14 }), 'image/png'); 15 })); 16 }, "toBlob with image/png returns a PNG Blob"); 17 </script>