fune/testing/web-platform/tests/webidl/ecmascript-binding/legacy-factor-function-subclass.window.js
Weizhong Xia 0108376e76 Bug 1730216 [wpt PR 30551] - Rename WebIDL to webidl, a=testonly
Automatic update from web-platform-tests
Rename WebIDL to webidl

WebIDL is renamed to webidl at up stream. Do this also in chromium to
unblock wpt-importer. Wpt-importer should be able to handle such cases
in future.

Bug: 1247327
Change-Id: Ib9c4ca3f4da55c6a25e56bc730a846b6fa95563b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3151416
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#920025}

--

wpt-commits: a370aad338d6ed743abb4d2c6ae84a7f1058558c
wpt-pr: 30551
2021-09-29 09:23:56 +00:00

13 lines
503 B
JavaScript

"use strict";
test(() => {
class CustomImage extends Image {}
var instance = new CustomImage();
assert_equals(
Object.getPrototypeOf(instance), CustomImage.prototype,
"Object.getPrototypeOf(instance) === CustomImage.prototype");
assert_true(instance instanceof CustomImage, "instance instanceof CustomImage");
assert_true(instance instanceof HTMLImageElement, "instance instanceof HTMLImageElement");
}, "[LegacyFactoryFunction] can be subclassed and correctly handles NewTarget");