blob: 41c4949537edd8b3a5f99b342816100563ab9107 [file] [log] [blame]
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(t => {
let start_length = history.length;
appHistory.onnavigate = t.step_func(e => {
e.transitionWhile(new Promise(resolve => t.step_timeout(() => {
resolve();
t.step_timeout(t.step_func_done(() => {
assert_equals(location.hash, "#1");
assert_equals(history.state, "update");
assert_equals(history.length, start_length);
}, 0));
}, 0)));
});
history.replaceState("update", "", "#1");
assert_equals(location.hash, "#1");
assert_equals(history.state, "update");
assert_equals(history.length, start_length);
}, "AppHistoryNavigateEvent's transitionWhile() should proceed if the given promise resolves");
</script>