diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html new file mode 100644 index 000000000..b95c8285b --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/toDataURL.lowercase.ascii.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: toDataURL.lowercase.ascii</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>toDataURL.lowercase.ascii</h1> +<p class="desc">toDataURL type is case-insensitive</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("toDataURL type is case-insensitive"); +_addTest(function(canvas, ctx) { + +var data = canvas.toDataURL('ImAgE/PnG'); +assert_regexp_match(data, /^data:image\/png[;,]/); + +// If JPEG is supported at all, it must be supported case-insensitively +data = canvas.toDataURL('image/jpeg'); +if (data.match(/^data:image\/jpeg[;,]/)) { + data = canvas.toDataURL('ImAgE/JpEg'); + assert_regexp_match(data, /^data:image\/jpeg[;,]/); +} + + +}); +</script> + |