toBlob.jpeg.html (599B)
1 <!DOCTYPE html> 2 <title>Canvas test: toBlob.jpeg</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/jpeg"); 14 }), 'image/jpeg'); 15 })); 16 }, "toBlob with image/jpeg returns a JPEG Blob"); 17 </script>