testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html
author Yi Xu <yiyix@chromium.org>
Mon, 10 Jan 2022 11:16:48 +0000
changeset 604175 8c8326a5e1017f214639db0061c86bad7911f51d
parent 529326 d4e1e62aed03db1d447f6b31b8d1347c2ad2e43b
permissions -rw-r--r--
Bug 1748573 [wpt PR 32242] - Update OffscreenCanvas variable name for tests, a=testonly Automatic update from web-platform-tests Update OffscreenCanvas variable name for tests As part of the effort to unify the offscreencanvas and htmlcanvas tests, the variable names that refer to the canvas is supposed to be the same for both cases. Update all offscreencanvas variable name to canvas. Bug:1275750 Change-Id: I82b5fe5ddac366838d31e15dabd78432a2a94786 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3330901 Reviewed-by: Juanmi Huertas <juanmihd@chromium.org> Commit-Queue: Yi Xu <yiyix@chromium.org> Cr-Commit-Position: refs/heads/main@{#955484} -- wpt-commits: 4f78b917b374b64d30bda6fe08d09fb3a85739e1 wpt-pr: 32242

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgb-3</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>

<h1>2d.fillStyle.parse.invalid.rgb-3</h1>
<p class="desc"></p>


<script>
var t = async_test("");
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');


ctx.fillStyle = '#0f0';
try { ctx.fillStyle = 'rgb(255, - 1, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
t.done();

});
</script>