<!DOCTYPE html><linkrel=authorhref="mailto:jarhar@chromium.org"><linkrel=helphref="https://github.com/whatwg/html/pull/7283"><linkrel=helphref="https://bugs.chromium.org/p/chromium/issues/detail?id=1266468"><linkrel=authorhref="mailto:gulukesh@gmail.com"><linkrel=helphref="https://bugs.chromium.org/p/chromium/issues/detail?id=1131234"><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><body><script>functionrunTest(type,testValue){promise_test(async()=>{constw=window.open(`resources/${type}-restore-events.html`);// Unfortunately, navigating |w| doesn't fire load events in this parent// window, so we have to make the child window manually tell this parent// window when it has loaded.awaitnewPromise(resolve=>window.loadResolver=resolve);// We can't navigate the child window until after a setTimeout.awaitnewPromise(resolve=>step_timeout(resolve,0));assert_not_equals(w.document.querySelector('input').value,testValue,`Test shouldn't start with the new value already in the input.`);w.document.querySelector('input').value=testValue;w.location.href='resources/loadresolver.html';awaitnewPromise(resolve=>window.loadResolver=resolve);w.history.back();awaitnewPromise(resolve=>window.loadResolver=resolve);// The value doesn't get restored until after a setTimeout.awaitnewPromise(resolve=>step_timeout(resolve,0));assert_equals(w.document.querySelector('input').value,testValue,'The input should have its value restored.');assert_false(w.seeninput||false,'The input event should not have been fired after restoration.');assert_false(w.seenchange||false,'The change event should not have been fired after restoration.');w.close();},`Verifies that form restoration does not fire input or change events for <input type=${type}>.`);}runTest('range','8');runTest('text','foo');</script>