fune/testing/web-platform/tests/imagebitmap-renderingcontext/context-creation-offscreen.html
Joshua Bell 6c5316e254 Bug 1617250 [wpt PR 21921] - WPT: Fix incorrect use of assert_object_equals, a=testonly
Automatic update from web-platform-tests
WPT: Fix incorrect use of assert_object_equals

This test was using assert_object_equals() to verify object identity,
similar to https://github.com/web-platform-tests/wpt/issues/20844
which (a) wasn't validating identity and (2) failing in all browsers
because that assert function is subtle/weird. Switch to just
assert_equals() and remove expectation file.

General issue: https://github.com/web-platform-tests/wpt/issues/2033

Change-Id: I9ee44d251b53955bb9101810142aac8e89a8b5be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068248
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Auto-Submit: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743639}

--

wpt-commits: 06000cecb5cf248e8edc9e73ccb71b0ce8f09c44
wpt-pr: 21921
2020-02-24 10:23:05 +00:00

18 lines
819 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 = new OffscreenCanvas(width, height);
var ctx = canvas.getContext('bitmaprenderer');
assert_true(ctx instanceof ImageBitmapRenderingContext);
assert_true("canvas" in ctx);
assert_equals(canvas, ctx.canvas);
}, "Test that canvas.getContext('bitmaprenderer') returns an instance of ImageBitmapRenderingContext and ctx.canvas on a ImageBitmapRenderingContext returns the original OffscreenCanvas");
</script>