async activelyCollectBFCacheEvent(context) {
    const session = context.driver.defaultSession;

    /** @type {LH.Crdp.Page.BackForwardCacheNotUsedEvent|undefined} */
    let bfCacheEvent = undefined;

    /**
     * @param {LH.Crdp.Page.BackForwardCacheNotUsedEvent} event
     */
    function onBfCacheNotUsed(event) {
      bfCacheEvent = event;
    }

    session.on('Page.backForwardCacheNotUsed', onBfCacheNotUsed);

    const history = await session.sendCommand('Page.getNavigationHistory');
    const entry = history.entries[history.currentIndex];

    // In theory, we should be able to use about:blank here
    // but that sometimes produces BrowsingInstanceNotSwapped failures.
    // DevTools uses chrome://terms as it's temporary page so we should stick with that.
    // https://github.com/GoogleChrome/lighthouse/issues/14665
    await Promise.all([
      session.sendCommand('Page.navigate', {url: 'chrome://terms'}),
      // DevTools e2e tests can sometimes fail on the next command if we progress too fast.
      // The only reliable way to prevent this is to wait for an arbitrary period of time after load.
      waitForLoadEvent(session, TEMP_PAGE_PAUSE_TIMEOUT).promise,
    ]);

    const [, frameNavigatedEvent] = await Promise.all([
      session.sendCommand('Page.navigateToHistoryEntry', {entryId: entry.id}),
      waitForFrameNavigated(session).promise,
    ]);

    // The bfcache failure event is not necessarily emitted by this point.
    // If we are expecting a bfcache failure event but haven't seen one, we should wait for it.
    // This timeout also allows the environment to "settle" before gathering enters it's cleanup phase.
    await new Promise(resolve => setTimeout(resolve, AFTER_RETURN_TIMEOUT));

    // If we still can't get the failure reasons after the timeout we should fail loudly,
    // otherwise this gatherer will return no failures when there should be failures.
    if (frameNavigatedEvent.type !== 'BackForwardCacheRestore' && !bfCacheEvent) {
      throw new Error('bfcache failed but the failure reasons were not emitted in time');
    }

    session.off('Page.backForwardCacheNotUsed', onBfCacheNotUsed);

    return bfCacheEvent;
  }
@param {LH.Gatherer.Context} context
@return {Promise<LH.Crdp.Page.BackForwardCacheNotUsedEvent|undefined>}