Update web-platform-tests to revision 06f77f6bfaa86f3643a79f1ec2c49c6b6955cf18

This commit is contained in:
WPT Sync Bot 2018-03-26 21:10:36 -04:00
parent 1981efcc35
commit c6c4fb2f7a
108 changed files with 2090 additions and 138 deletions

View file

@ -1,12 +1,8 @@
// To make sure that we take the snapshot at the right time, we do double
// requestAnimationFrame. In the second frame, we take a screenshot, that makes
// sure that we already have a full frame.
function importWorkletAndTerminateTestAfterAsyncPaint(worklet, code) {
if (typeof worklet === 'undefined') {
takeScreenshot();
return;
}
// Imports code into a worklet. E.g.
//
// importWorklet(CSS.paintWorklet, {url: 'script.js'});
// importWorklet(CSS.paintWorklet, '/* javascript string */');
function importWorklet(worklet, code) {
let url;
if (typeof code === 'object') {
url = code.url;
@ -15,11 +11,23 @@ function importWorkletAndTerminateTestAfterAsyncPaint(worklet, code) {
url = URL.createObjectURL(blob);
}
worklet.addModule(url).then(function() {
return worklet.addModule(url);
}
// To make sure that we take the snapshot at the right time, we do double
// requestAnimationFrame. In the second frame, we take a screenshot, that makes
// sure that we already have a full frame.
async function importWorkletAndTerminateTestAfterAsyncPaint(worklet, code) {
if (typeof worklet === 'undefined') {
takeScreenshot();
return;
}
await importWorklet(worklet, code);
requestAnimationFrame(function() {
requestAnimationFrame(function() {
requestAnimationFrame(function() {
takeScreenshot();
});
takeScreenshot();
});
});
}

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<title>CSS Flexbox Test: Flex item as table, specified width less than minimum intrinsic width</title>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#layout-algorithm" title="9. Flex Layout Algorithm">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="display:flex; width:100px; background:red;">
<div style="display:table; width:10px; max-width:10px; height:100px; background:green;">
<div style="width:100px; height:10px; background:green;"></div>
</div>
</div>

View file

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#invoke-a-layout-callback">
<link rel="match" href="fallback-ref.html">
<meta name="assert" content="This test checks that a layout() class performing layout on an invalid child will fallback to block layout." />
<style>
.test {
background: red;
border: solid 2px;
width: 100px;
}
.test > div {
height: 100px;
}
@supports (display: layout(bad-child-layout)) {
.test {
display: layout(bad-child-layout);
background: green;
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div></div>
</div>
<script id="code" type="text/worklet">
registerLayout('bad-child-layout', class {
static get inputProperties() { return ['--fail']; }
*intrinsicSizes() {}
*layout(children, _, __, styleMap) {
if (styleMap.get('--fail').toString() !== 'true') {
this.child = children[0];
}
// Try to perform layout on the child. If its invalid (we skipped the if
// statement above) we should fallback to block layout.
const fragment = yield this.child.layoutNextFragment({});
return {autoBlockSize: 0, childFragments: [fragment]};
}
});
</script>
<script>
function raf() {
return new Promise((resolve) => {
requestAnimationFrame(() => {
resolve();
});
});
}
(async function() {
if (typeof CSS.layoutWorklet === 'undefined') {
takeScreenshot();
return;
}
await importWorklet(CSS.layoutWorklet, document.getElementById('code').textContent);
// Ensure that all instances have a child to perform an invalid layout upon.
const test = document.getElementsByClassName('test')[0];
for (let i = 0; i < 100; i++) {
test.innerHTML = '<div><div>';
await raf();
}
// The next layout should mean that we will fallback to block.
test.innerHTML = '<div></div>';
test.style.setProperty('--fail', 'true');
// Finish up the test.
await raf();
await raf();
takeScreenshot();
})();
</script>
</html>

View file

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#invoke-a-layout-callback">
<link rel="match" href="fallback-ref.html">
<meta name="assert" content="This test checks that a layout() class performing layout on an invalid fragment request will fallback to block layout." />
<style>
.test {
background: red;
border: solid 2px;
width: 100px;
}
.test > div {
height: 100px;
}
@supports (display: layout(bad-request)) {
.test {
display: layout(bad-request);
background: green;
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div></div>
</div>
<script id="code" type="text/worklet">
registerLayout('bad-request', class {
static get inputProperties() { return ['--fail']; }
*intrinsicSizes() {}
*layout(children, _, __, styleMap) {
if (styleMap.get('--fail').toString() !== 'true') {
this.request = children[0].layoutNextFragment({});
}
// Try to perform layout on the child. If its invalid (we skipped the if
// statement above) we should fallback to block layout.
const childFragments = yield [this.request];
return {autoBlockSize: 0, childFragments};
}
});
</script>
<script>
function raf() {
return new Promise((resolve) => {
requestAnimationFrame(() => {
resolve();
});
});
}
(async function() {
if (typeof CSS.layoutWorklet === 'undefined') {
takeScreenshot();
return;
}
await importWorklet(CSS.layoutWorklet, document.getElementById('code').textContent);
// Ensure that all instances have a child to perform an invalid layout upon.
const test = document.getElementsByClassName('test')[0];
for (let i = 0; i < 100; i++) {
test.innerHTML = '<div><div>';
await raf();
}
// The next layout should mean that we will fallback to block.
test.innerHTML = '<div></div>';
test.style.setProperty('--fail', 'true');
// Finish up the test.
await raf();
await raf();
takeScreenshot();
})();
</script>
</html>

View file

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#invoke-a-layout-callback">
<link rel="match" href="fallback-ref.html">
<meta name="assert" content="This test checks that a layout() class returning an invalid fragment will fallback to block layout." />
<style>
.test {
background: red;
border: solid 2px;
width: 100px;
}
.test > div {
height: 100px;
}
@supports (display: layout(bad-request)) {
.test {
display: layout(bad-request);
background: green;
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div></div>
</div>
<script id="code" type="text/worklet">
registerLayout('bad-request', class {
static get inputProperties() { return ['--fail']; }
*intrinsicSizes() {}
*layout(children, _, __, styleMap) {
if (styleMap.get('--fail').toString() !== 'true') {
this.fragment = yield children[0].layoutNextFragment({});
}
// Return, if the fragment is invalid (we skipped the if statement above)
// we should fallback to block layout.
return {autoBlockSize: 0, childFragments: [this.fragment]};
}
});
</script>
<script>
function raf() {
return new Promise((resolve) => {
requestAnimationFrame(() => {
resolve();
});
});
}
(async function() {
if (typeof CSS.layoutWorklet === 'undefined') {
takeScreenshot();
return;
}
await importWorklet(CSS.layoutWorklet, document.getElementById('code').textContent);
// Ensure that all instances have a child to perform an invalid layout upon.
const test = document.getElementsByClassName('test')[0];
for (let i = 0; i < 100; i++) {
test.innerHTML = '<div><div>';
await raf();
}
// The next layout should mean that we will fallback to block.
test.innerHTML = '<div></div>';
test.style.setProperty('--fail', 'true');
// Finish up the test.
await raf();
await raf();
takeScreenshot();
})();
</script>
</html>

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize">
<link rel="match" href="layout-child-ref.html">
<meta name="assert" content="This test checks that fixing the block size of children works as expected." />
<style>
.test {
writing-mode: vertical-rl;
background: red;
margin: 10px;
height: 100px;
}
.htb {
writing-mode: horizontal-tb;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-block-size: 10;
--inline-size-expected: 2;
--block-size-expected: 10;
}
.vrl {
writing-mode: vertical-rl;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-block-size: 10;
--inline-size-expected: 2;
--block-size-expected: 10;
}
@supports (display: layout(test)) {
.test {
background: green;
display: layout(test);
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div class="htb"></div>
<div class="vrl"></div>
<!-- min/max-width should have no effect, fixedBlockSize wins. -->
<div class="htb" style="max-width: 5px;"></div>
<div class="vrl" style="max-width: 5px;"></div>
<div class="htb" style="min-width: 15px;"></div>
<div class="vrl" style="min-width: 15px;"></div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-fixed-sizes-worklet.js'});
</script>

View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedblocksize">
<link rel="match" href="layout-child-ref.html">
<meta name="assert" content="This test checks that fixing the block size of children works as expected." />
<style>
.test {
background: red;
margin: 10px;
width: 100px;
}
.htb {
writing-mode: horizontal-tb;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-block-size: 10;
--inline-size-expected: 3;
--block-size-expected: 10;
}
.vrl {
writing-mode: vertical-rl;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-block-size: 10;
--inline-size-expected: 3;
--block-size-expected: 10;
}
@supports (display: layout(test)) {
.test {
background: green;
display: layout(test);
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div class="htb"></div>
<div class="vrl"></div>
<!-- min/max-height should have no effect, fixedBlockSize wins. -->
<div class="htb" style="max-height: 5px;"></div>
<div class="vrl" style="max-height: 5px;"></div>
<div class="htb" style="min-height: 15px;"></div>
<div class="vrl" style="min-height: 15px;"></div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-fixed-sizes-worklet.js'});
</script>

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize">
<link rel="match" href="layout-child-ref.html">
<meta name="assert" content="This test checks that fixing the inline size of children works as expected." />
<style>
.test {
writing-mode: vertical-rl;
background: red;
margin: 10px;
height: 100px;
}
.htb {
writing-mode: horizontal-tb;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-inline-size: 10;
--inline-size-expected: 10;
--block-size-expected: 3;
}
.vrl {
writing-mode: vertical-rl;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-inline-size: 10;
--inline-size-expected: 10;
--block-size-expected: 3;
}
@supports (display: layout(test)) {
.test {
background: green;
display: layout(test);
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div class="htb"></div>
<div class="vrl"></div>
<!-- min/max-height should have no effect, fixedInlineSize wins. -->
<div class="htb" style="max-height: 5px;"></div>
<div class="vrl" style="max-height: 5px;"></div>
<div class="htb" style="min-height: 15px;"></div>
<div class="vrl" style="min-height: 15px;"></div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-fixed-sizes-worklet.js'});
</script>

View file

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-fixedinlinesize">
<link rel="match" href="layout-child-ref.html">
<meta name="assert" content="This test checks that fixing the inline size of children works as expected." />
<style>
.test {
background: red;
margin: 10px;
width: 100px;
}
.htb {
writing-mode: horizontal-tb;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-inline-size: 10;
--inline-size-expected: 10;
--block-size-expected: 2;
}
.vrl {
writing-mode: vertical-rl;
visibility: hidden;
width: 3px;
height: 2px;
--fixed-inline-size: 10;
--inline-size-expected: 10;
--block-size-expected: 2;
}
@supports (display: layout(test)) {
.test {
background: green;
display: layout(test);
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div class="htb"></div>
<div class="vrl"></div>
<!-- min/max-width should have no effect, fixedInlineSize wins. -->
<div class="htb" style="max-width: 5px;"></div>
<div class="vrl" style="max-width: 5px;"></div>
<div class="htb" style="min-width: 15px;"></div>
<div class="vrl" style="min-width: 15px;"></div>
</div>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-fixed-sizes-worklet.js'});
</script>

View file

@ -0,0 +1,52 @@
import {areArraysEqual} from '/common/arrays.js';
function parseNumber(value) {
const num = parseInt(value.toString());
if (isNaN(num)) return undefined;
return num;
}
registerLayout('test', class {
static get childInputProperties() {
return [
'--fixed-inline-size',
'--fixed-block-size',
'--inline-size-expected',
'--block-size-expected'
];
}
*intrinsicSizes() {}
*layout(children, edges, constraints, styleMap) {
const childFragments = yield children.map((child) => {
const childConstraints = {};
const fixedInlineSize = parseNumber(child.styleMap.get('--fixed-inline-size'));
const fixedBlockSize = parseNumber(child.styleMap.get('--fixed-block-size'));
return child.layoutNextFragment({fixedInlineSize, fixedBlockSize});
});
const actual = childFragments.map((childFragment) => {
return {
inlineSize: childFragment.inlineSize,
blockSize: childFragment.blockSize,
};
});
const expected = children.map((child) => {
return {
inlineSize: parseInt(child.styleMap.get('--inline-size-expected').toString()),
blockSize: parseInt(child.styleMap.get('--block-size-expected').toString()),
};
});
const equalityFunc = (a, b) => {
return a.inlineSize == b.inlineSize && a.blockSize == b.blockSize;
};
if (!areArraysEqual(expected, actual, equalityFunc)) {
return {autoBlockSize: 0, childFragments};
}
return {autoBlockSize: 100, childFragments};
}
});

View file

@ -16,9 +16,11 @@ registerLayout('test', class {
return child.styleMap.get('--child').toString().trim();
});
if (!areArraysEqual(expected, actual))
return {autoBlockSize: 0};
const childFragments = yield children.map((child) => { return child.layoutNextFragment({}); });
return {autoBlockSize: 100};
if (!areArraysEqual(expected, actual))
return {autoBlockSize: 0, childFragments};
return {autoBlockSize: 100, childFragments};
}
});

View file

@ -0,0 +1,71 @@
<!DOCTYPE html>
<title>Reference</title>
<style>
/* establish context */
.container {
clear: both;
padding: 10px;
color: blue;
font: 20px/1 Ahem;
}
.zero {
width: 0;
}
.infinite {
width: 400px; /* close enough */
}
/* visualize size contribution */
.container > div {
float: left;
border: solid orange 20px;
border-style: none solid;
}
.container > div > div {
border-right: solid 20px aqua;
}
/* controls for min-width */
/* content = 100% = 80px = 4ch + border */
/* choose sizes that are larger than content to see if how they take effect */
.control {
width: 60px;
}
.raw-percent,
.calc-percent {
width: 160px;
margin-right: -100px;
}
.no-percent {
width: 160px;
}
</style>
<!-- calculating min-content widths -->
<div class='zero container'>
<div><div class="control">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="raw-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="calc-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="no-percent">ppp pp</div></div>
</div>
<!-- calculating max-content widths -->
<div class='infinite container'>
<div><div class="control">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="raw-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="calc-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="no-percent">p p</div></div>
</div>

View file

@ -0,0 +1,71 @@
<!DOCTYPE html>
<title>Percentages of min-width on non-replaced blocks are ignored for intrinsic sizing and resolved afterwards</title>
<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic-contribution">
<link rel="match" href="intrinsic-percent-non-replaced-001-ref.html">
<style>
/* establish context */
.container {
clear: both;
padding: 10px;
color: blue;
font: 20px/1 Ahem;
}
.zero {
width: 0;
}
.infinite {
width: 400px; /* close enough */
}
/* visualize size contribution */
.container > div {
float: left;
border: solid orange 20px;
border-style: none solid;
}
.container > div > div {
border-right: solid 20px aqua;
}
/* test min-width */
/* content = 100% = 80px = 4ch + border */
/* choose sizes that are larger than content to see if how they take effect */
.raw-percent {
min-width: 200%;
}
.calc-percent {
min-width: calc(160px + 0%);
}
.no-percent {
min-width: 160px;
}
</style>
<!-- calculating min-content widths -->
<div class='zero container'>
<div><div class="control">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="raw-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="calc-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="no-percent">ppp pp</div></div>
</div>
<!-- calculating max-content widths -->
<div class='infinite container'>
<div><div class="control">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="raw-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="calc-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="no-percent">p p</div></div>
</div>

View file

@ -0,0 +1,71 @@
<!DOCTYPE html>
<title>Reference</title>
<style>
/* establish context */
.container {
clear: both;
padding: 10px;
color: blue;
font: 20px/1 Ahem;
}
.zero {
width: 0;
}
.infinite {
width: 400px; /* close enough */
}
/* visualize size contribution */
.container > div {
float: left; /* shrinkwrap */
border: solid orange 20px;
border-style: none solid;
}
.container > div > div {
border-right: solid 20px aqua;
}
/* controls for width, max-width */
/* content = 100% = 80px = 4ch + border */
/* choose sizes that are larger than content to see if how they take effect */
.control {
width: 60px;
}
.raw-percent,
.calc-percent {
width: 40px;
margin-right: 20px;
}
.no-percent {
width: 40px;
}
</style>
<!-- calculating min-content widths -->
<div class='zero container'>
<div><div class="control">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="raw-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="calc-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="no-percent">ppp pp</div></div>
</div>
<!-- calculating max-content widths -->
<div class='infinite container'>
<div><div class="control">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="raw-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="calc-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="no-percent">p p</div></div>
</div>

View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<title>Percentages of max-width on non-replaced blocks are ignored for intrinsic sizing and resolved afterwards</title>
<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic-contribution">
<style>
/* establish context */
.container {
clear: both;
padding: 10px;
color: blue;
font: 20px/1 Ahem;
}
.zero {
width: 0;
}
.infinite {
width: 400px; /* close enough */
}
/* visualize size contribution */
.container > div {
float: left; /* shrinkwrap */
border: solid orange 20px;
border-style: none solid;
}
.container > div > div {
border-right: solid 20px aqua;
}
/* test max-width */
/* content = 100% = 80px = 4ch + border */
/* choose sizes that are smaller than content to see if how they take effect */
.raw-percent {
max-width: 50%;
}
.calc-percent {
max-width: calc(40px + 0%);
}
.no-percent {
max-width: 40px;
}
</style>
<!-- calculating min-content widths -->
<div class='zero container'>
<div><div class="control">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="raw-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="calc-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="no-percent">ppp pp</div></div>
</div>
<!-- calculating max-content widths -->
<div class='infinite container'>
<div><div class="control">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="raw-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="calc-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="no-percent">p p</div></div>
</div>

View file

@ -0,0 +1,71 @@
<!DOCTYPE html>
<title>Percentages of width on non-replaced blocks are ignored for intrinsic sizing and resolved afterwards</title>
<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic-contribution">
<link rel="match" href="intrinsic-percent-non-replaced-002-ref.html">
<style>
/* establish context */
.container {
clear: both;
padding: 10px;
color: blue;
font: 20px/1 Ahem;
}
.zero {
width: 0;
}
.infinite {
width: 400px; /* close enough */
}
/* visualize size contribution */
.container > div {
float: left;
border: solid orange 20px;
border-style: none solid;
}
.container > div > div {
border-right: solid 20px aqua;
}
/* test width */
/* content = 100% = 80px = 4ch + border */
/* choose sizes that are different than content to see if how they take effect */
.raw-percent {
width: 50%;
}
.calc-percent {
width: calc(40px + 0%);
}
.no-percent {
width: 40px;
}
</style>
<!-- calculating min-content widths -->
<div class='zero container'>
<div><div class="control">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="raw-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="calc-percent">ppp pp</div></div>
</div>
<div class='zero container'>
<div><div class="no-percent">ppp pp</div></div>
</div>
<!-- calculating max-content widths -->
<div class='infinite container'>
<div><div class="control">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="raw-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="calc-percent">p p</div></div>
</div>
<div class='infinite container'>
<div><div class="no-percent">p p</div></div>
</div>

View file

@ -0,0 +1,51 @@
<!doctype html>
<meta charset="utf-8">
<title>'block-size' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('block-size', [
{ syntax: 'auto' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('min-block-size', [
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('max-block-size', [
{ syntax: 'none' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
</script>

View file

@ -0,0 +1,23 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-family' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
// FIXME: font-family is list-valued. Run list-valued tests here too.
runUnsupportedPropertyTests('font-family', [
'Georgia',
'"Gill Sans"',
'sans-serif',
]);
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-language-override' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-language-override', [
{ syntax: 'normal' },
]);
runUnsupportedPropertyTests('font-language-override', [
'"SRB"',
]);
</script>

View file

@ -0,0 +1,21 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-optical-sizing' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-optical-sizing', [
{ syntax: 'auto' },
{ syntax: 'none' },
]);
</script>

View file

@ -0,0 +1,26 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-palette' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-palette', [
{ syntax: 'normal' },
{ syntax: 'light' },
{ syntax: 'dark' },
]);
runUnsupportedPropertyTests('font-palette', [
'Augusta'
]);
</script>

View file

@ -0,0 +1,22 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-presentation' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-presentation', [
{ syntax: 'auto' },
{ syntax: 'text' },
{ syntax: 'emoji' },
]);
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-size-adjust' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-size-adjust', [
{ syntax: 'none' },
{
syntax: '<number>',
specified: assert_is_equal_with_range_handling
},
]);
</script>

View file

@ -13,53 +13,60 @@
<script>
'use strict';
runPropertyTests('font-size', [
{
syntax: 'xx-small',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'x-small',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'small',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'medium',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'large',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'x-large',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'xx-large',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'larger',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'smaller',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling,
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling,
computed: (_, result) => assert_is_unit('px', result)
},
]);
for (const property of ['font-size', 'font-min-size', 'font-max-size']) {
// font-max-size also supports 'infinity' keyword
const infinity = property === 'font-max-size' ?
[{ syntax: 'infinity'}] : [];
runPropertyTests(property, [
...infinity,
{
syntax: 'xx-small',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'x-small',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'small',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'medium',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'large',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'x-large',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'xx-large',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'larger',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: 'smaller',
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling,
computed: (_, result) => assert_is_unit('px', result)
},
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling,
computed: (_, result) => assert_is_unit('px', result)
},
]);
}
</script>

View file

@ -0,0 +1,32 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-stretch' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-stretch', [
{ syntax: 'normal' },
{ syntax: 'ultra-condensed' },
{ syntax: 'extra-condensed' },
{ syntax: 'condensed' },
{ syntax: 'semi-condensed' },
{ syntax: 'semi-expanded' },
{ syntax: 'expanded' },
{ syntax: 'extra-expanded' },
{ syntax: 'ultra-expanded' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
]);
</script>

View file

@ -0,0 +1,27 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-synthesis' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-synthesis', [
{ syntax: 'none' },
{ syntax: 'weight' },
{ syntax: 'style' },
{ syntax: 'small-caps' },
]);
runUnsupportedPropertyTests('font-synthesis', [
'weight style', 'style small-caps', 'small-caps weight style'
]);
</script>

View file

@ -0,0 +1,31 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-variant-alternates' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-variant-alternates', [
{ syntax: 'normal' },
{ syntax: 'historical-forms' },
]);
runUnsupportedPropertyTests('font-variant-alternates', [
'stylistic(foo)',
'styleset(foo)',
'character-variant(foo)',
'swash(foo)',
'ornaments(foo)',
'annotation(foo)',
'swash(foo) annotation(foo2)',
]);
</script>

View file

@ -0,0 +1,22 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-variant-emoji' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-variant-emoji', [
{ syntax: 'auto' },
{ syntax: 'text' },
{ syntax: 'emoji' },
]);
</script>

View file

@ -0,0 +1,21 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-variant' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runUnsupportedPropertyTests('font-variant', [
'normal', 'no-common-ligatures proportional-nums',
'common-ligatures tabular-nums', 'small-caps slashed-zero'
]);
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>'font-variation-settings' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('font-variation-settings', [
{ syntax: 'normal' },
]);
runUnsupportedPropertyTests('font-variation-settings', [
'"XHGT" 0.7',
]);
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>'font' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runUnsupportedPropertyTests('font', [
'1.2em "Fira Sans", sans-serif',
'italic 1.2em "Fira Sans", serif',
'italic small-caps bold 16px/2 cursive',
'small-caps bold 24px/1 sans-serif',
'caption',
]);
</script>

View file

@ -0,0 +1,30 @@
<!doctype html>
<meta charset="utf-8">
<title>'*-gap' properties</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om/#dom-stylepropertymapreadonly-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om/#reify-stylevalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
for (const prefix of ['column', 'row']) {
runPropertyTests(`${prefix}-gap`, [
{ syntax: 'normal' },
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
]);
}
</script>

View file

@ -0,0 +1,51 @@
<!doctype html>
<meta charset="utf-8">
<title>'inline-size' property</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/testhelper.js"></script>
<script src="resources/testsuite.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
runPropertyTests('inline-size', [
{ syntax: 'auto' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('min-inline-size', [
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
runPropertyTests('max-inline-size', [
{ syntax: 'none' },
{
syntax: '<percentage>',
specified: assert_is_equal_with_range_handling
},
{
syntax: '<length>',
specified: assert_is_equal_with_range_handling
},
]);
</script>

View file

@ -31,6 +31,13 @@ function checkModification(e, funcName, args, expectedRes, before, after,
}
setClass(e, before);
var obs;
// If we have MutationObservers available, do some checks to make
// sure attribute sets are happening at sane times.
if (self.MutationObserver) {
obs = new MutationObserver(() => {});
obs.observe(e, { attributes: true });
}
if (shouldThrow) {
assert_throws(expectedException, function() {
var list = e.classList;
@ -40,6 +47,21 @@ function checkModification(e, funcName, args, expectedRes, before, after,
var list = e.classList;
var res = list[funcName].apply(list, args);
}
if (obs) {
var mutationRecords = obs.takeRecords();
obs.disconnect();
if (shouldThrow) {
assert_equals(mutationRecords.length, 0,
"There should have been no mutation");
} else if (funcName == "replace") {
assert_equals(mutationRecords.length == 1,
expectedRes,
"Should have a mutation exactly when replace() returns true");
} else {
// For other functions, would need to check when exactly
// mutations are supposed to happen.
}
}
if (!shouldThrow) {
assert_equals(res, expectedRes, "wrong return value");
}

View file

@ -33,6 +33,8 @@ promise_test(function() {
assert_equals(typeof capabilities.groupId, "string", "groupId must be a string.");
if (mediainfo.kind == "audioinput") {
assert_equals(typeof capabilities.echoCancellation, "object", "echoCancellation must be an object.");
assert_equals(typeof capabilities.autoGainControl, "object", "autoGainControl must be an object.");
assert_equals(typeof capabilities.noiseSuppression, "object", "noiseSuppression must be an object.");
}
if (mediainfo.kind == "videoinput") {
assert_equals(typeof capabilities.facingMode, "object", "facingMode must be an object.");

View file

@ -12,6 +12,8 @@
var videoCapabilities = stream.getVideoTracks()[0].getCapabilities();
assert_true(undefined !== audioCapabilities.deviceId, "MediaTrackCapabilities's deviceId should exist for an audio track.");
assert_true(undefined !== audioCapabilities.echoCancellation, "MediaTrackCapabilities's echoCancellation should exist for an audio track.");
assert_true(undefined !== audioCapabilities.autoGainControl, "MediaTrackCapabilities's autoGainControl should exist for an audio track.");
assert_true(undefined !== audioCapabilities.noiseSuppression, "MediaTrackCapabilities's noiseSuppression should exist for an audio track.");
assert_true(undefined !== videoCapabilities.deviceId, "MediaTrackCapabilities's deviceId should exist for a video track.");
});
});

View file

@ -11,17 +11,19 @@ Install the following dependencies:
- [the Mozilla Firefox web browser](https://mozilla.org/firefox)
- [the GeckoDriver server](https://github.com/mozilla/geckodriver)
Once these dependencies are satisfied, the tests may be run from a command line
by executing the following command from this directory:
Make sure `geckodriver` can be found in your `PATH`.
tox
Currently, the tests should be run with Firefox Nightly.
In order to specify the path to Firefox Nightly, use the following command-line option:
Currently, the tests should be run with the latest *Firefox Nightly*. In order to
specify the path to Firefox Nightly, use the following command-line option:
tox -- --binary=/path/to/FirefoxNightly
### Automated Script
Alternatively, you may run `tools/ci/ci_resources_unittest.sh`, which only depends on
Python 2. The script will install other dependencies automatically and start `tox` with
the correct arguments.
## Authoring Tests
Test cases are expressed as `.html` files located within the `tests/`

View file

@ -8,7 +8,7 @@ import urlparse
from abc import ABCMeta, abstractmethod
from ..testrunner import Stop
from protocol import Protocol
from protocol import Protocol, BaseProtocolPart
here = os.path.split(__file__)[0]
@ -411,7 +411,23 @@ class WdspecRun(object):
self.result_flag.set()
class ConnectionlessBaseProtocolPart(BaseProtocolPart):
def execute_script(self, script, async=False):
pass
def set_timeout(self, timeout):
pass
def wait(self):
pass
def set_window(self, handle):
pass
class ConnectionlessProtocol(Protocol):
implements = [ConnectionlessBaseProtocolPart]
def connect(self):
pass

View file

@ -0,0 +1,48 @@
<!DOCTYPE html>
<title>DedicatedWorker: import</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// Start a dedicated worker for |scriptURL| and wait until MessageEvents from
// imported modules up to |expectedNumberOfImportedModules|.
function RunImportTest(scriptURL, expectedNumberOfImportedModules) {
return new Promise(resolve => {
let numberOfImportedModules = 0;
const worker = new Worker(scriptURL, { type: 'module' });
worker.onmessage = e => {
if (e.data === 'LOADED')
++numberOfImportedModules;
if (numberOfImportedModules === expectedNumberOfImportedModules)
resolve();
};
});
}
promise_test(() => {
return RunImportTest('resources/static-import-worker.js', 2);
}, 'Test static import on DedicatedWorkerGlobalScope.');
promise_test(() => {
return RunImportTest('resources/nested-static-import-worker.js', 3);
}, 'Test nested static import on DedicatedWorkerGlobalScope.');
promise_test(() => {
return RunImportTest(
'resources/static-import-and-then-dynamic-import-worker.js', 3);
}, 'Test static import and then dynamic import on DedicatedWorkerGlobalScope.');
promise_test(() => {
return RunImportTest('resources/dynamic-import-worker.js', 2);
}, 'Test dynamic import on DedicatedWorkerGlobalScope.');
promise_test(() => {
return RunImportTest('resources/nested-dynamic-import-worker.js', 3);
}, 'Test nested dynamic import on DedicatedWorkerGlobalScope.');
promise_test(() => {
return RunImportTest(
'resources/dynamic-import-and-then-static-import-worker.js', 3);
}, 'Test dynamic import and then static import on DedicatedWorkerGlobalScope.');
</script>

View file

@ -1,21 +0,0 @@
<!DOCTYPE html>
<title>DedicatedWorker: static import</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(() => {
const worker = new Worker('resources/static-import-worker.js',
{ type: 'module' });
return new Promise(resolve => worker.onmessage = resolve)
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
}, 'Test static import on DedicatedWorkerGlobalScope.');
promise_test(() => {
const worker = new Worker('resources/nested-static-import-worker.js',
{ type: 'module' });
return new Promise(resolve => worker.onmessage = resolve)
.then(msg_event => assert_equals(msg_event.data, 'LOADED'));
}, 'Test nested static import on DedicatedWorkerGlobalScope.');
</script>

View file

@ -0,0 +1,2 @@
import('./static-import-worker.js')
.then(module => postMessage('LOADED'));

View file

@ -0,0 +1,2 @@
import('./post-message-on-load-worker.js')
.then(module => postMessage('LOADED'));

View file

@ -0,0 +1,2 @@
import('./dynamic-import-worker.js')
.then(module => postMessage('LOADED'));

View file

@ -1 +1,2 @@
import './static-import-worker.js';
postMessage('LOADED')

View file

@ -0,0 +1,2 @@
import './dynamic-import-worker.js';
postMessage('LOADED');

View file

@ -1 +1,2 @@
import './post-message-on-load-worker.js';
postMessage('LOADED');