drainForTest method
Runs any pending PTY ingest immediately. For unit/widget tests that do not
pump frames (the default schedule uses post-frame callbacks).
Implementation
@visibleForTesting
Future<void> drainForTest() async {
while (_buf.isNotEmpty || _drainScheduled || _advancing) {
if (_drainScheduled || _buf.isNotEmpty) {
await _drain();
} else {
await Future<void>.delayed(Duration.zero);
}
}
await _applyPendingScroll();
}