      return window.activeElementOnPageHide ===
                 document.querySelector('#toBeFocused');
      }),
      'activeElement on pagehide');

    assert_true(
      await pageA.execute_script(() => {
          return document.activeElement ===
                 document.querySelector('#toBeFocused');
      }),
      'activeElement after navigation');

    assert_array_equals(
      await pageA.execute_script(() => getRecordedEvents()),
      [
        'window.load',
        'window.pageshow',
     