anchor.diff:    '"toJsonDuration":'
   ];
   
  -runTest(
  -    {Uri entryPoint,
  -    Map<String, String> memorySourceFiles: const <String, String>{},
  -    Uri packageConfig,
  -    Uri librariesSpecificationUri,
  -    List<String> options,
  -    SerializationStrategy strategy: const BytesInMemorySerializationStrategy(),
  -    bool useDataKinds: false}) async {
  -  OutputCollector collector1 = new OutputCollector();
  -  CompilationResult result1 = await runCompiler(
  -      entryPoint: entryPoint,
  -      memorySourceFiles: memorySourceFiles,
  -      packageConfig: packageConfig,
  -      librariesSpecificationUri: librariesSpecificationUri,
  -      options: options,
  -      outputProvider: collector1,
  -      beforeRun: (Compiler compiler) {
  -        compiler.kernelLoader.forceSerialization = true;
  -      });
  -  Expect.isTrue(result1.isSuccess);
  -
  -  OutputCollector collector2 = new OutputCollector();
  -  CompilationResult result = await runCompiler(
  -      entryPoint: entryPoint,
  -      memorySourceFiles: memorySourceFiles,
  -      packageConfig: packageConfig,
  -      librariesSpecificationUri: librariesSpecificationUri,
  -      options: options,
  -      outputProvider: collector2,
  -      beforeRun: (Compiler compiler) {
  -        compiler.kernelLoader.forceSerialization = true;
  -        compiler.stopAfterTypeInference = true;
  -      });
  -  Expect.isTrue(result.isSuccess);
  -  Compiler compiler = result.compiler;
  -  GlobalTypeInferenceResults globalInferenceResults =
  -      compiler.globalInference.resultsForTesting;
  -  GlobalTypeInferenceResults newGlobalInferenceResults =
  -      cloneInferenceResults(compiler, globalInferenceResults, strategy);
  -
  -  Map<OutputType, Map<String, String>> output = collector1.clear();
  -
  -  compiler.generateJavaScriptCode(newGlobalInferenceResults);
  -  Map<OutputType, Map<String, String>> newOutput = collector2.clear();
  -
  -  Expect.setEquals(output.keys, newOutput.keys, "Output type mismatch.");
  -
  -  output.forEach((OutputType outputType, Map<String, String> fileMap) {
  -    Map<String, String> newFileMap = newOutput[outputType];
  +void finishCompileAndCompare(
  +    Map<OutputType, Map<String, String>> expectedOutput,
  +    OutputCollector actualOutputCollector,
  +    Compiler compiler,
  +    SerializationStrategy strategy,
  +    {bool stoppedAfterClosedWorld = false,
  +    bool stoppedAfterTypeInference = false}) {
  +  if (stoppedAfterClosedWorld) {
  +    JsClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
  +    JsClosedWorld newClosedWorld =
  +        cloneClosedWorld(compiler, closedWorld, strategy);
  +    compiler.performGlobalTypeInference(newClosedWorld);
  +  }
  +
  +  if (stoppedAfterClosedWorld || stoppedAfterTypeInference) {
  +    GlobalTypeInferenceResults globalInferenceResults =
  +        compiler.globalInference.resultsForTesting;
  +    GlobalTypeInferenceResults newGlobalInferenceResults =
  +        cloneInferenceResults(compiler, globalInferenceResults, strategy);
  +    compiler.generateJavaScriptCode(newGlobalInferenceResults);
  +  }
  +  var actualOutput = actualOutputCollector.clear();
  +  Expect.setEquals(
  +      expectedOutput.keys, actualOutput.keys, "Output type mismatch.");
  +
  +  void check(OutputType outputType, Map<String, String> fileMap) {
  +    Map<String, String> newFileMap = actualOutput[outputType];
       Expect.setEquals(fileMap.keys, newFileMap.keys,
           "File mismatch for output type $outputType.");
       fileMap.forEach((String fileName, String code) {
  
positive.code: 
  import 'package:compiler/compiler_new.dart';
  import 'package:compiler/src/compiler.dart';
  import 'package:compiler/src/inferrer/types.dart';
  import 'package:compiler/src/serialization/strategies.dart';
  import 'package:expect/expect.dart';
  
negative.code:           compiler.abstractValueStrategy,
            newComponent,
            worldData);
    List<int> newWorldData =
        strategy.serializeGlobalTypeInferenceResults(newResults);
    checkData(worldData, newWorldData);
    return newResults;
  }
  