gecko-dev/testing/web-platform/tests/imagebitmap-renderingcontext/context-preserves-canvas.html
guest271314 3627f43379 Bug 1604951 [wpt PR 20855] - Fix imagebitmap-renderingcontext/context-preserves-canvas.html, a=testonly
Automatic update from web-platform-tests
Fix imagebitmap-renderingcontext/context-preserves-canvas.html

See https://github.com/web-platform-tests/wpt/pull/20776#issuecomment-567101328 for context.

Co-authored-by: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
--

wpt-commits: a85693b3367f9b7f40865a175e198ea0fd484b01
wpt-pr: 20855
2020-01-08 00:50:08 +00:00

22 lines
870 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Canvas's ImageBitmapRenderingContext test</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://html.spec.whatwg.org/multipage/canvas.html#the-imagebitmap-rendering-context">
<script>
test(function() {
var width = 10;
var height = 10;
var canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
var ctx = canvas.getContext('bitmaprenderer');
var dstCanvas = ctx.canvas;
assert_true("canvas" in ctx);
assert_equals(dstCanvas, ctx.canvas);
assert_equals(canvas, ctx.canvas);
assert_equals(dstCanvas.width, width);
assert_equals(dstCanvas.height, height);
}, "Test that ctx.canvas on a ImageBitmapRenderingContext returns the original canvas");
</script>