function createMockSession() {
  const mockSendCommand = createMockSendCommandFn();
  return {
    setTargetInfo: fnAny(),
    sendCommand: mockSendCommand,
    sendCommandAndIgnore: mockSendCommand,
    setNextProtocolTimeout: fnAny(),
    hasNextProtocolTimeout: fnAny(),
    getNextProtocolTimeout: fnAny(),
    once: createMockOnceFn(),
    on: createMockOnFn(),
    off: fnAny(),
    addProtocolMessageListener: createMockOnFn(),
    removeProtocolMessageListener: fnAny(),
    dispose: fnAny(),
    onCrashPromise: fnAny().mockReturnValue(new Promise(() => {})),

    /** @return {LH.Gatherer.ProtocolSession} */
    asSession() {
      return this;
    },
  };
}
@typedef {import('../../gather/driver/execution-context.js')} ExecutionContext