mirror of
https://github.com/servo/servo.git
synced 2025-10-15 16:00:28 +01:00
Update web-platform-tests to revision 9a6026305062c90d84a567d81434010dde6c6c22
This commit is contained in:
parent
d77bf218fa
commit
906e45aab0
210 changed files with 6028 additions and 383 deletions
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
window.parent.document.test.step_timeout(() => {
|
||||
document.write("document.write body contents\n")
|
||||
document.close();
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
||||
}, 0);
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,28 @@
|
|||
<!doctype html>
|
||||
<title>async document.write in a module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
// Expose {test} in the iframe for using the step_timeout helper.
|
||||
document.test = t;
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let onLoadWasCalled = false;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
// Don't call the event handler another time after document.write.
|
||||
iframe.onload = null;
|
||||
onLoadWasCalled = true;
|
||||
});
|
||||
document.addEventListener("documentWriteDone", t.step_func_done(() => {
|
||||
assert_equals(iframe.onload, null);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
}));
|
||||
|
||||
iframe.src = "module-delayed-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
(async () => {
|
||||
let module = await import("./module-dynamic-import.mjs");
|
||||
})();
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let onLoadWasCalled = false;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
iframe.onload = null;
|
||||
onLoadWasCalled = true;
|
||||
});
|
||||
document.addEventListener("documentWriteDone", t.step_func_done(() => {
|
||||
assert_true(onLoadWasCalled);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "document.write body contents\n");
|
||||
}));
|
||||
|
||||
iframe.src = "module-dynamic-import-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,4 @@
|
|||
document.write("document.write body contents\n");
|
||||
document.close();
|
||||
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
|
@ -1,7 +1,7 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<script type=module>
|
||||
document.write("FAIL");
|
||||
document.write("document.write body contents\n");
|
||||
document.close();
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
||||
</script>
|
||||
PASS
|
||||
Initial body contents
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
import "./module-static-import-delayed.mjs"
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,27 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
// Expose {test} in the iframe for using the step_timeout helper.
|
||||
document.test = t;
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let onLoadWasCalled = false;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
iframe.onload = null;
|
||||
onLoadWasCalled = true;
|
||||
});
|
||||
document.addEventListener("documentWriteDone", t.step_func_done(() => {
|
||||
assert_true(onLoadWasCalled);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "document.write body contents\n");
|
||||
}));
|
||||
|
||||
iframe.src = "module-static-import-delayed-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
window.parent.document.test.step_timeout(() => {
|
||||
document.write("document.write body contents\n")
|
||||
document.close();
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
||||
}, 0);
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
import "./module-static-import.mjs"
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const iframe = document.createElement("iframe");
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
|
||||
let testEndWasCalled = false;
|
||||
document.addEventListener("documentWriteDone", t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
testEndWasCalled = true;
|
||||
}));
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
assert_true(testEndWasCalled);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
});
|
||||
|
||||
iframe.src = "module-static-import-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
||||
ß
|
|
@ -0,0 +1,4 @@
|
|||
document.write("document.write body contents\n");
|
||||
document.close();
|
||||
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
let delay = new Promise(
|
||||
resolve => window.parent.document.test.step_timeout(resolve, 0));
|
||||
|
||||
delay.then(() => {
|
||||
document.write("FAIL");
|
||||
document.close();
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
||||
});
|
||||
|
||||
await delay;
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,28 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
// Expose {test} in the iframe for using the step_timeout helper.
|
||||
document.test = t;
|
||||
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let onLoadWasCalled = false;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
iframe.onload = null;
|
||||
onLoadWasCalled = true;
|
||||
});
|
||||
document.addEventListener("documentWriteDone", t.step_func_done(() => {
|
||||
assert_true(onLoadWasCalled);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
}));
|
||||
|
||||
iframe.src = "module-tla-delayed-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
await new Promise(resolve => {
|
||||
document.write("document.write body contents\n");
|
||||
document.close();
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
||||
resolve();
|
||||
});
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,28 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
// Expose {test} in the iframe for using the step_timeout helper.
|
||||
document.test = t;
|
||||
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let onLoadWasCalled = false;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
iframe.onload = null;
|
||||
onLoadWasCalled = true;
|
||||
});
|
||||
document.addEventListener("documentWriteDone", t.step_func_done(() => {
|
||||
assert_true(onLoadWasCalled);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
}));
|
||||
|
||||
iframe.src = "module-tla-immediate-promise-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
await import("./module-tla-import.mjs");
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let testEndWasCalled = false;
|
||||
document.addEventListener("documentWriteDone", t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
testEndWasCalled = true;
|
||||
}));
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
assert_true(testEndWasCalled, 'documentWriteDone event was not sent');
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
});
|
||||
|
||||
iframe.src = "module-tla-import-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,4 @@
|
|||
document.write("document.write body contents\n");
|
||||
document.close();
|
||||
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
|
@ -0,0 +1,10 @@
|
|||
<!doctype html>
|
||||
<script type=module>
|
||||
await new Promise(resolve => {
|
||||
window.parent.document.test.step_timeout(resolve, 0));
|
||||
document.write("document.write body contents\n");
|
||||
document.close();
|
||||
window.parent.document.dispatchEvent(new CustomEvent("documentWriteDone"));
|
||||
});
|
||||
</script>
|
||||
Initial body contents
|
|
@ -0,0 +1,28 @@
|
|||
<!doctype html>
|
||||
<title>document.write in an imported module</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
// Expose {test} in the iframe for using the step_timeout helper.
|
||||
document.test = t;
|
||||
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
let onLoadWasCalled = false;
|
||||
iframe.onload = t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
iframe.onload = null;
|
||||
onLoadWasCalled = true;
|
||||
});
|
||||
document.addEventListener("documentWriteDone", t.step_func_done(() => {
|
||||
assert_true(onLoadWasCalled);
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
}));
|
||||
|
||||
iframe.src = "module-tla-promise-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
</script>
|
|
@ -7,11 +7,16 @@
|
|||
<script>
|
||||
async_test(t => {
|
||||
const iframe = document.createElement("iframe");
|
||||
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
document.addEventListener("documentWriteDone", t.step_func(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
}));
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
|
||||
});
|
||||
|
||||
iframe.src = "module-iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
iframe.onerror = t.unreached_func("Error loading iframe");
|
||||
iframe.onload = t.step_func_done(() => {
|
||||
assert_equals(iframe.contentDocument.body.textContent, "PASS\n");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue