anchor.diff:          '--packages=${packageConfig.path}',
         ];
   
  -      final StreamController<List<int>> streamController =
  -          StreamController<List<int>>();
  -      final StreamController<List<int>> stdoutStreamController =
  -          StreamController<List<int>>();
  -      final IOSink ioSink = IOSink(stdoutStreamController.sink);
  -      StreamController<Result> receivedResults = StreamController<Result>();
  -      final outputParser = OutputParser(receivedResults);
  -      stdoutStreamController.stream
  -          .transform(utf8.decoder)
  -          .transform(const LineSplitter())
  -          .listen(outputParser.listener);
  -
  -      Future<int> result =
  -          starter(args, input: streamController.stream, output: ioSink);
  -      streamController.add('compile $library\n'.codeUnits);
  +      final frontendServer = FrontendServer();
  +      Future<int> result = frontendServer.open(args);
  +      frontendServer.compile(library);
         int count = 0;
  -      receivedResults.stream.listen((Result compiledResult) {
  +      frontendServer.listen((Result compiledResult) {
           CompilationResult result =
               CompilationResult.parse(compiledResult.status);
           if (count == 0) {
  
positive.code:         '--output-dill=${dillFile.path}'
        ];
  
        final StreamController<List<int>> inputStreamController =
            StreamController<List<int>>();
        final StreamController<List<int>> stdoutStreamController =
            StreamController<List<int>>();
        final IOSink ioSink = IOSink(stdoutStreamController.sink);
        StreamController<Result> receivedResults = StreamController<Result>();
  
        final outputParser = OutputParser(receivedResults);
        stdoutStreamController.stream
            .transform(utf8.decoder)
            .transform(const LineSplitter())
            .listen(outputParser.listener);
  
        Future<int> result =
            starter(args, input: inputStreamController.stream, output: ioSink);
        inputStreamController.add('compile ${src1.uri}\n'.codeUnits);
        receivedResults.stream.listen((Result compiledResult) {
          CompilationResult result =
              CompilationResult.parse(compiledResult.status);
          expect(dillFile.existsSync(), equals(true));
  
negative.code:             count += 1;
  
              // Restart with no changes
              frontendServer.accept();
              frontendServer.reset();
              frontendServer.recompile(null,
                  entryPoint: dart2js.path, boundaryKey: 'x$count');
            } else if (count == 1) {
              // Restart. Expect full kernel file.
              expect(dillFile.existsSync(), equals(true));
  