diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /image/test/mochitest/test_image_crossorigin_data_url.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'image/test/mochitest/test_image_crossorigin_data_url.html')
-rw-r--r-- | image/test/mochitest/test_image_crossorigin_data_url.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/image/test/mochitest/test_image_crossorigin_data_url.html b/image/test/mochitest/test_image_crossorigin_data_url.html new file mode 100644 index 000000000..9facc00d4 --- /dev/null +++ b/image/test/mochitest/test_image_crossorigin_data_url.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Test for handling of 'crossorigin' attribute on CSS link with data: URL</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<div id="someuniqueidhere"></div> +<img id="testimg" crossorigin src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4z8AAAAMBAQD3A0FDAAAAAElFTkSuQmCC"> +<script> + var t = async_test("img@crossorigin with data: src"); + window.addEventListener("load", t.step_func_done(function() { + var img = document.getElementById("testimg"); + assert_equals(img.naturalWidth, 1, "Should have 1px width"); + assert_equals(img.naturalHeight, 1, "Should have 1px height"); + var c = document.createElement("canvas"); + c.width = c.height = 1; + var ctx = c.getContext("2d"); + ctx.drawImage(img, 0, 0); + var data = ctx.getImageData(0, 0, 1, 1); + assert_equals(data.width, 1, "Should have 1px data width"); + assert_equals(data.height, 1, "Should have 1px data height"); + assert_equals(data.data[0], 255, "Should have lots of red"); + assert_equals(data.data[1], 0, "Should have no green"); + assert_equals(data.data[2], 0, "Should have no blue"); + assert_equals(data.data[3], 255, "Should have no translucency"); + })); +</script> |