ts\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-dynamic-import-iframe.html";
  document.body.appendChild(iframe);
});
</script>
