 but we use async_test()'s nice
// infrastructure around t.step() to capture errors in event listeners. This is
// necessary since it seems like in Chrome, exceptions in beforeprint/afterprint
// event listeners are not propagated to error events. See
// https://crbug.com/977828.
const t = async_test();
const log = [];
function out(str) {
  log.push(str);
  output.appendChild(document.createTextNode(str + "\n"));
}
function testBtn(btn) {
  btn.remove();
  window.addEventListener("beforeprint", function (ev