2 <title>Canvas test: toDataURL.lowercase.ascii
</title>
3 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
6 <canvas id=
"c" width=
"100" height=
"50"><p class=
"fallback">FAIL (fallback content)
</p></canvas>
8 var canvas
= document
.getElementById('c');
9 var ctx
= canvas
.getContext("2d");
11 var data
= canvas
.toDataURL('ImAgE/PnG');
12 ok(data
.match(/^data:image\/png[;,]/), "data =~ /^data:image\\/png[;,]/");
14 // If JPEG is supported at all, it must be supported case-insensitively
15 data
= canvas
.toDataURL('image/jpeg');
16 if (data
.match(/^data:image\/jpeg[;,]/)) {
17 data
= canvas
.toDataURL('ImAgE/JpEg');
18 ok(data
.match(/^data:image\/jpeg[;,]/), "data =~ /^data:image\\/jpeg[;,]/");