gecko-dev/testing/web-platform/tests/priority-hints/img-attr-named-constructor.tentative.html
Philip Jägenstedt aa9f1f9f59 Bug 1480904 [wpt PR 12304] - Wrap a stray assert (causing harness error) in a test, a=testonly
Automatic update from web-platform-testsWrap a stray assert (causing harness error) in a test

--

wpt-commits: a3eddf0b1e19aa1152e38fdaabf31cbe67d4c6fd
wpt-pr: 12304
2018-08-08 12:09:59 +00:00

26 lines
1.3 KiB
HTML

<!DOCTYPE html>
<title>Priority Hints - Image element</title>
<meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img id=img1 src=/images/green.png importance=high>
<img id=img2 src=/images/green.png importance=low>
<img id=img3 src=/images/green.png importance=auto>
<img id=img4 src=/images/green.png importance=xyz>
<img id=img5 src=/images/green.png>
<script>
test(() => {
assert_equals(img1.importance, "high", "high importance is a valid IDL value on the image element");
assert_equals(img2.importance, "low", "high importance is a valid IDL value on the image element");
assert_equals(img3.importance, "auto", "auto importance is a valid IDL value on the image element");
assert_equals(img4.importance, "auto", "invalid importance reflects as 'auto' IDL attribute on the image element");
assert_equals(img5.importance, "auto", "missing importance reflects as 'auto' IDL attribute on the image element");
}, "importance attribute on <img> elements should reflect valid IDL values");
test(() => {
const img = new Image();
assert_equals(img.importance, "auto");
}, "importance of new Image() is 'auto'");
</script>