diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html')
-rw-r--r-- | testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html b/testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html new file mode 100644 index 0000000000..bfcf05013e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.same.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: initial.reset.same</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>initial.reset.same</h1> +<p class="desc">Setting size (not changing the value) resets canvas to transparent black</p> + + +<script> +var t = async_test("Setting size (not changing the value) resets canvas to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + +var canvas = new OffscreenCanvas(100, 50); +var ctx = canvas.getContext('2d'); + +canvas.width = 100; +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 50, 50); +_assertPixel(canvas, 20,20, 255,0,0,255); +canvas.width = 100; +_assertPixel(canvas, 20,20, 0,0,0,0); +t.done(); + +}); +</script> |