TerminalEngine.fromBinding constructor

  1. @visibleForTesting
TerminalEngine.fromBinding(
  1. EngineBinding binding, {
  2. required TerminalConfig config,
  3. void schedule(
    1. void ()
    )?,
})

Test-only escape hatch: wire a pre-built EngineBinding. This skips the lazy-init path and constructs the TerminalEngineClient eagerly so the test can assert on it immediately. An optional schedule hook lets the test drive the drain pipeline synchronously (no real frame pumping).

Implementation

@visibleForTesting
factory TerminalEngine.fromBinding(
  EngineBinding binding, {
  required TerminalConfig config,
  void Function(void Function())? schedule,
}) {
  final engine = TerminalEngine(config: config);
  engine._bindEager(binding, schedule: schedule);
  return engine;
}