internalBootstrapVmTest function

void internalBootstrapVmTest(
  1. Function getMain(),
  2. SendPort sendPort
)

Bootstraps a vm test to communicate with the test runner over an isolate.

Implementation

void internalBootstrapVmTest(Function Function() getMain, SendPort sendPort) {
  var platformChannel =
      MultiChannel<Object?>(IsolateChannel<Object?>.connectSend(sendPort));
  var testControlChannel = platformChannel.virtualChannel()
    ..pipe(serializeSuite(getMain));
  platformChannel.sink.add(testControlChannel.id);

  platformChannel.stream.forEach((message) {
    assert(message == 'debug');
    debugger(message: 'Paused by test runner');
    platformChannel.sink.add('done');
  });
}