<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
  window.onload = t.step_func(() => {
    let abort_signal;
    let onabort_called = false;
    let canceled_in_second_handler = false;
    navigation.addEventListener("navigate", t.step_func(e => {
      abort_signal = e.signal;
      abort_signal.onabort = () => onabort_called = true;
      window.stop();
    }));
    navigation.addEventListener("navigate", t