diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative.html | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative.html new file mode 100644 index 0000000000..1bc53a1f18 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/decode/image-decode-path-changes-svg.tentative.html @@ -0,0 +1,82 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<meta name="timeout" content="long"> +<title>SVGImageElement.prototype.decode(), href mutation tests.</title> +<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> +"use strict"; + +// src tests +// ------------------- +promise_test(function(t) { + var img = document.createElementNS('http://www.w3.org/2000/svg', 'image'); + img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "/images/green.png"); + var promise = img.decode(); + img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "/images/green.svg"); + return promise_rejects_dom(t, "EncodingError", promise); +}, document.title + " xlink:href changes fail decode."); + +promise_test(function(t) { + var img = document.createElementNS('http://www.w3.org/2000/svg', 'image'); + img.setAttribute('href', "/images/green.png"); + var promise = img.decode(); + img.setAttribute('href', "/images/green.svg"); + return promise_rejects_dom(t, "EncodingError", promise); +}, document.title + " href changes fail decode."); + +promise_test(function(t) { + var img = document.createElementNS('http://www.w3.org/2000/svg', 'image'); + img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "/images/green.png"); + var first_promise = img.decode(); + img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "/images/green.svg"); + var second_promise = img.decode(); + assert_not_equals(first_promise, second_promise); + return Promise.all([ + promise_rejects_dom(t, "EncodingError", first_promise), + second_promise + ]); +}, document.title + " xlink:href changes fail decode; following good decode succeeds."); + +promise_test(function(t) { + var img = document.createElementNS('http://www.w3.org/2000/svg', 'image'); + img.setAttribute('href', "/images/green.png"); + var first_promise = img.decode(); + img.setAttribute('href', "/images/green.svg"); + var second_promise = img.decode(); + assert_not_equals(first_promise, second_promise); + return Promise.all([ + promise_rejects_dom(t, "EncodingError", first_promise), + second_promise + ]); +}, document.title + " href changes fail decode; following good decode succeeds."); + +promise_test(function(t) { + var img = document.createElementNS('http://www.w3.org/2000/svg', 'image'); + img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "/images/green.png"); + var first_promise = img.decode(); + img.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', "/non/existent/path.png"); + var second_promise = img.decode(); + assert_not_equals(first_promise, second_promise); + return Promise.all([ + promise_rejects_dom(t, "EncodingError", first_promise), + promise_rejects_dom(t, "EncodingError", second_promise) + ]); +}, document.title + " xlink:href changes fail decode; following bad decode fails."); + +promise_test(function(t) { + var img = document.createElementNS('http://www.w3.org/2000/svg', 'image'); + img.setAttribute('href', "/images/green.png"); + var first_promise = img.decode(); + img.setAttribute('href', "/non/existent/path.png"); + var second_promise = img.decode(); + assert_not_equals(first_promise, second_promise); + return Promise.all([ + promise_rejects_dom(t, "EncodingError", first_promise), + promise_rejects_dom(t, "EncodingError", second_promise) + ]); +}, document.title + " href changes fail decode; following bad decode fails."); + +</script> |