Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<meta charset="UTF-8">
<title>OffscreenCanvas test: 2d.shadow.attributes.shadowOffset.invalid</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>
<h1>2d.shadow.attributes.shadowOffset.invalid</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.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = Infinity;
ctx.shadowOffsetY = Infinity;
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = -Infinity;
ctx.shadowOffsetY = -Infinity;
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = NaN;
ctx.shadowOffsetY = NaN;
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = 'string';
ctx.shadowOffsetY = 'string';
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = true;
ctx.shadowOffsetY = true;
_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
_assertSame(ctx.shadowOffsetY, 1, "ctx.shadowOffsetY", "1");
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 2;
ctx.shadowOffsetX = false;
ctx.shadowOffsetY = false;
_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0");
_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0");
t.done();
});
</script>