Update web-platform-tests to revision cd0ac591860335b75cdc2576fdc57c840afec870

This commit is contained in:
WPT Sync Bot 2020-09-16 08:20:57 +00:00
parent 03fb9c5d6e
commit 8504f7d13d
288 changed files with 7779 additions and 1022 deletions

View file

@ -10,7 +10,9 @@ async_test(t => {
const iframe = document.createElement("iframe");
iframe.onunhandledrejection = t.unreached_func("Unhandled promise rejection detected");
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");

View file

@ -6,17 +6,20 @@
<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');
let onLoadWasCalled = false;
iframe.onload = t.step_func(() => {
onLoadWasCalled = true;
assert_equals(iframe.contentDocument.body.textContent, "Initial body contents\n");
// Don't call the event handler another time after document.write.
iframe.onload = null;
});
document.addEventListener("documentWriteDone", t.step_func_done(() => {
assert_true(onLoadWasCalled, "onload must be called");
assert_equals(iframe.contentDocument.body.textContent, "document.write body contents\n");
}));
iframe.src = "module-tla-import-iframe.html";
document.body.appendChild(iframe);

View file

@ -1,10 +1,11 @@
<!doctype html>
<script type=module>
await new Promise(resolve => {
window.parent.document.test.step_timeout(resolve, 0));
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

View file

@ -9,18 +9,14 @@ async_test(t => {
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);
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-tla-promise-iframe.html";
document.body.appendChild(iframe);