From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../test/crossorigin/image-allow-credentials.png | Bin 0 -> 844 bytes .../image-allow-credentials.png^headers^ | 2 + dom/canvas/test/crossorigin/image-allow-star.png | Bin 0 -> 844 bytes .../test/crossorigin/image-allow-star.png^headers^ | 1 + dom/canvas/test/crossorigin/image.png | Bin 0 -> 844 bytes dom/canvas/test/crossorigin/mochitest.toml | 22 +++ .../crossorigin/test_canvas2d_crossorigin.html | 212 ++++++++++++++++++++ .../test/crossorigin/test_video_crossorigin.html | 219 +++++++++++++++++++++ .../test_webgl_crossorigin_textures.html | 143 ++++++++++++++ dom/canvas/test/crossorigin/video.sjs | 52 +++++ 10 files changed, 651 insertions(+) create mode 100644 dom/canvas/test/crossorigin/image-allow-credentials.png create mode 100644 dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ create mode 100644 dom/canvas/test/crossorigin/image-allow-star.png create mode 100644 dom/canvas/test/crossorigin/image-allow-star.png^headers^ create mode 100644 dom/canvas/test/crossorigin/image.png create mode 100644 dom/canvas/test/crossorigin/mochitest.toml create mode 100644 dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html create mode 100644 dom/canvas/test/crossorigin/test_video_crossorigin.html create mode 100644 dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html create mode 100644 dom/canvas/test/crossorigin/video.sjs (limited to 'dom/canvas/test/crossorigin') diff --git a/dom/canvas/test/crossorigin/image-allow-credentials.png b/dom/canvas/test/crossorigin/image-allow-credentials.png new file mode 100644 index 0000000000..df24ac6d34 Binary files /dev/null and b/dom/canvas/test/crossorigin/image-allow-credentials.png differ diff --git a/dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ b/dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ new file mode 100644 index 0000000000..a03f99a9c0 --- /dev/null +++ b/dom/canvas/test/crossorigin/image-allow-credentials.png^headers^ @@ -0,0 +1,2 @@ +Access-Control-Allow-Origin: http://mochi.test:8888 +Access-Control-Allow-Credentials: true diff --git a/dom/canvas/test/crossorigin/image-allow-star.png b/dom/canvas/test/crossorigin/image-allow-star.png new file mode 100644 index 0000000000..df24ac6d34 Binary files /dev/null and b/dom/canvas/test/crossorigin/image-allow-star.png differ diff --git a/dom/canvas/test/crossorigin/image-allow-star.png^headers^ b/dom/canvas/test/crossorigin/image-allow-star.png^headers^ new file mode 100644 index 0000000000..cb762eff80 --- /dev/null +++ b/dom/canvas/test/crossorigin/image-allow-star.png^headers^ @@ -0,0 +1 @@ +Access-Control-Allow-Origin: * diff --git a/dom/canvas/test/crossorigin/image.png b/dom/canvas/test/crossorigin/image.png new file mode 100644 index 0000000000..df24ac6d34 Binary files /dev/null and b/dom/canvas/test/crossorigin/image.png differ diff --git a/dom/canvas/test/crossorigin/mochitest.toml b/dom/canvas/test/crossorigin/mochitest.toml new file mode 100644 index 0000000000..e45b2624cd --- /dev/null +++ b/dom/canvas/test/crossorigin/mochitest.toml @@ -0,0 +1,22 @@ +[DEFAULT] +support-files = [ + "image-allow-credentials.png", + "image-allow-credentials.png^headers^", + "image-allow-star.png", + "image-allow-star.png^headers^", + "image.png", + "video.sjs", +] + +["test_canvas2d_crossorigin.html"] +skip-if = [ + "http3", + "http2", +] + +["test_video_crossorigin.html"] +subsuite = "gpu" + +["test_webgl_crossorigin_textures.html"] +subsuite = "gpu" + diff --git a/dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html b/dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html new file mode 100644 index 0000000000..5c40ea028a --- /dev/null +++ b/dom/canvas/test/crossorigin/test_canvas2d_crossorigin.html @@ -0,0 +1,212 @@ + + + + + Test for Bug 685518 + + + + +Mozilla Bug 685518 +

+ +
+
+
+ + diff --git a/dom/canvas/test/crossorigin/test_video_crossorigin.html b/dom/canvas/test/crossorigin/test_video_crossorigin.html new file mode 100644 index 0000000000..89ca8e4a10 --- /dev/null +++ b/dom/canvas/test/crossorigin/test_video_crossorigin.html @@ -0,0 +1,219 @@ + + + + + Test for Bug 682299 + + + + + +Mozilla Bug 682299 +

+ +
+
+
+ + diff --git a/dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html b/dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html new file mode 100644 index 0000000000..545048a340 --- /dev/null +++ b/dom/canvas/test/crossorigin/test_webgl_crossorigin_textures.html @@ -0,0 +1,143 @@ + +WebGL cross-origin textures test + + + + +

FAIL (fallback content)

+
+ diff --git a/dom/canvas/test/crossorigin/video.sjs b/dom/canvas/test/crossorigin/video.sjs new file mode 100644 index 0000000000..1101d3c5b3 --- /dev/null +++ b/dom/canvas/test/crossorigin/video.sjs @@ -0,0 +1,52 @@ +function parseQuery(request, key) { + var params = request.queryString.split("&"); + for (var j = 0; j < params.length; ++j) { + var p = params[j]; + if (p == key) { + return true; + } + if (p.indexOf(key + "=") == 0) { + return p.substring(key.length + 1); + } + if (p.indexOf("=") < 0 && key == "") { + return p; + } + } + return false; +} + +function handleRequest(request, response) { + var name = parseQuery(request, "name"); + var type = parseQuery(request, "type"); + var cors = parseQuery(request, "cors"); + var file = Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIProperties) + .get("CurWorkD", Ci.nsIFile); + var fis = Cc["@mozilla.org/network/file-input-stream;1"].createInstance( + Ci.nsIFileInputStream + ); + var bis = Cc["@mozilla.org/binaryinputstream;1"].createInstance( + Ci.nsIBinaryInputStream + ); + var split = name.split("/"); + for (var i = 0; i < split.length; ++i) { + file.append(split[i]); + } + fis.init(file, -1, -1, false); + bis.setInputStream(fis); + var bytes = bis.readBytes(bis.available()); + response.setHeader("Content-Length", "" + bytes.length, false); + response.setHeader("Content-Type", type, false); + if (cors == "anonymous") { + response.setHeader("Access-Control-Allow-Origin", "*", false); + } else if (cors == "use-credentials") { + response.setHeader( + "Access-Control-Allow-Origin", + "http://mochi.test:8888", + false + ); + response.setHeader("Access-Control-Allow-Credentials", "true", false); + } + response.write(bytes, bytes.length); + bis.close(); +} -- cgit v1.2.3