etPrototypeOf(ev), Event.prototype);
      assert_equals(this, window);
      assert_equals(ev.target, window);
      assert_equals(ev.type, "afterprint");
    });
  });
  out("before calling print()");
  print();
  out("after calling print()");
  t.step(() => {
    try {
      assert_array_equals(log, [
        "before calling print()",
        "beforeprint",
        "afterprint",
        "after calling print()",
      ]);
    } catch (err) {
      try {
        assert_array_equals(log, [
          "before