summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
blob: 1a95d4a6dd8ae73b69de1be1d9454853eef52b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<title>Canvas test: toBlob.jpeg</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<canvas id="c"></canvas>
<script>
async_test(function() {
    on_event(window, "load", this.step_func(function() {
        var canvas = document.getElementById('c');
        var ctx = canvas.getContext('2d');
        canvas.toBlob(this.step_func_done(function(data) {
            assert_equals(data.type, "image/jpeg");
        }), 'image/jpeg');
    }));
}, "toBlob with image/jpeg returns a JPEG Blob");
</script>