blob: d1f022f584218fec9fb6fb584175adabd7a1a286 [file] [log] [blame]
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="i" src="/common/blank.html"></iframe>
<script>
promise_test(async t => {
await new Promise(resolve => window.onload = resolve);
let oncurrentchange_called = false;
i.contentWindow.appHistory.oncurrentchange = t.step_func(e => {
oncurrentchange_called = true;
assert_equals(e.from, i.contentWindow.appHistory.current);
assert_equals(e.navigationType, "reload");
assert_equals(i.contentWindow.appHistory.current.index, 0);
});
i.contentWindow.appHistory.onnavigate = e => e.transitionWhile(Promise.resolve());
let result = i.contentWindow.appHistory.reload();
assert_true(oncurrentchange_called);
await result.committed;
}, "AppHistoryCurrentChangeEvent fires for appHistory.reload() intercepted by transitionWhile");
</script>