mirror of
https://github.com/servo/servo.git
synced 2025-10-16 08:20:22 +01:00
Update web-platform-tests to revision cd0ac591860335b75cdc2576fdc57c840afec870
This commit is contained in:
parent
03fb9c5d6e
commit
8504f7d13d
288 changed files with 7779 additions and 1022 deletions
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue