summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/cross-origin-opener-policy/resources/fully-loaded.js
blob: d40e00af432097e27d10295df5bbf349c6357c0d (plain)
1
2
3
4
5
6
7
8
9
10
// Return a promise, which resolves when new navigations aren't considered
// client-side redirects anymore.
//
// Note: A long `setTimeout` is used, because client-side redirect is an
// heuristic and isn't clearly specified.
function fullyLoaded() {
  return new Promise((resolve, reject) => {
    addEventListener('load', () => setTimeout(resolve, 2000))
  });
}