for one of two conditions here.  For browsers
      // with a bfcache the original suspended timer will fire.
      // Alternatively, if the browser reloads the page the original
      // message will be sent again.  Wait for either of these
      // two events.
      return Promise.race([wait_for_message('foo'), innerDelay]);
    }).then(_ => {
      win.close();
    });
  });
}, 'history.back() handles nested iframe timer correctly');

</script>
