anchor.diff:        ]);
       }, overrides: contextOverrides);
   
  -    testUsingContext('builds iOS release AOT snapshot', () async {
  +    testUsingContext('builds Android arm profile AOT snapshot', () async {
  +      fs.file('main.dill').writeAsStringSync('binary magic');
  +
  +      final String outputPath = fs.path.join('build', 'foo');
  +      fs.directory(outputPath).createSync(recursive: true);
  +
  +      genSnapshot.outputs = <String, String>{
  +        fs.path.join(outputPath, 'vm_snapshot_data'): '',
  +        fs.path.join(outputPath, 'isolate_snapshot_data'): '',
  +        fs.path.join(outputPath, 'vm_snapshot_instr'): '',
  +        fs.path.join(outputPath, 'isolate_snapshot_instr'): '',
  +        fs.path.join(outputPath, 'snapshot.d'): '${fs.path.join(outputPath, 'vm_snapshot_data')} : ',
  +      };
  +
  +      final RunResult successResult = new RunResult(new ProcessResult(1, 0, '', ''));
  +      when(xcode.cc(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  +      when(xcode.clang(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  +
  +      final int genSnapshotExitCode = await snapshotter.build(
  +        platform: TargetPlatform.android_arm,
  +        buildMode: BuildMode.profile,
  +        mainPath: 'main.dill',
  +        packagesPath: '.packages',
  +        outputPath: outputPath,
  +        buildSharedLibrary: false,
  +        previewDart2: true,
  +      );
  +
  +      expect(genSnapshotExitCode, 0);
  +      expect(genSnapshot.callCount, 1);
  +      expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
  +      expect(genSnapshot.snapshotType.mode, BuildMode.profile);
  +      expect(genSnapshot.packagesPath, '.packages');
  +      expect(genSnapshot.additionalArgs, <String>[
  +        '--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
  +        '--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
  +        '--embedder_entry_points_manifest=$kVmEntrypoints',
  +        '--embedder_entry_points_manifest=$kIoEntries',
  +        '--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
  +        '--reify-generic-functions',
  +        '--strong',
  +        '--snapshot_kind=app-aot-blobs',
  +        '--vm_snapshot_data=build/foo/vm_snapshot_data',
  +        '--isolate_snapshot_data=build/foo/isolate_snapshot_data',
  +        '--vm_snapshot_instructions=build/foo/vm_snapshot_instr',
  +        '--isolate_snapshot_instructions=build/foo/isolate_snapshot_instr',
  +        '--no-sim-use-hardfp',
  +        '--no-use-integer-division',
  +        'main.dill',
  +      ]);
  +    }, overrides: contextOverrides);
  +
  +    testUsingContext('builds Android arm64 profile AOT snapshot', () async {
  +      fs.file('main.dill').writeAsStringSync('binary magic');
  +
  +      final String outputPath = fs.path.join('build', 'foo');
  +      fs.directory(outputPath).createSync(recursive: true);
  +
  +      genSnapshot.outputs = <String, String>{
  +        fs.path.join(outputPath, 'vm_snapshot_data'): '',
  +        fs.path.join(outputPath, 'isolate_snapshot_data'): '',
  +        fs.path.join(outputPath, 'vm_snapshot_instr'): '',
  +        fs.path.join(outputPath, 'isolate_snapshot_instr'): '',
  +        fs.path.join(outputPath, 'snapshot.d'): '${fs.path.join(outputPath, 'vm_snapshot_data')} : ',
  +      };
  +
  +      final RunResult successResult = new RunResult(new ProcessResult(1, 0, '', ''));
  +      when(xcode.cc(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  +      when(xcode.clang(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  +
  +      final int genSnapshotExitCode = await snapshotter.build(
  +        platform: TargetPlatform.android_arm64,
  +        buildMode: BuildMode.profile,
  +        mainPath: 'main.dill',
  +        packagesPath: '.packages',
  +        outputPath: outputPath,
  +        buildSharedLibrary: false,
  +        previewDart2: true,
  +      );
  +
  +      expect(genSnapshotExitCode, 0);
  +      expect(genSnapshot.callCount, 1);
  +      expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
  +      expect(genSnapshot.snapshotType.mode, BuildMode.profile);
  +      expect(genSnapshot.packagesPath, '.packages');
  +      expect(genSnapshot.additionalArgs, <String>[
  +        '--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
  +        '--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
  +        '--embedder_entry_points_manifest=$kVmEntrypoints',
  +        '--embedder_entry_points_manifest=$kIoEntries',
  +        '--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
  +        '--reify-generic-functions',
  +        '--strong',
  +        '--snapshot_kind=app-aot-blobs',
  +        '--vm_snapshot_data=build/foo/vm_snapshot_data',
  +        '--isolate_snapshot_data=build/foo/isolate_snapshot_data',
  +        '--vm_snapshot_instructions=build/foo/vm_snapshot_instr',
  +        '--isolate_snapshot_instructions=build/foo/isolate_snapshot_instr',
  +        'main.dill',
  +      ]);
  +    }, overrides: contextOverrides);
  +
  +    testUsingContext('builds iOS release armv7 AOT snapshot', () async {
  +      fs.file('main.dill').writeAsStringSync('binary magic');
  +
  +      final String outputPath = fs.path.join('build', 'foo');
  +      fs.directory(outputPath).createSync(recursive: true);
  +
  +      genSnapshot.outputs = <String, String>{
  +        fs.path.join(outputPath, 'snapshot_assembly.S'): '',
  +        fs.path.join(outputPath, 'snapshot.d'): '${fs.path.join(outputPath, 'snapshot_assembly.S')} : ',
  +      };
  +
  +      final RunResult successResult = new RunResult(new ProcessResult(1, 0, '', ''));
  +      when(xcode.cc(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  +      when(xcode.clang(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  +
  +      final int genSnapshotExitCode = await snapshotter.build(
  +        platform: TargetPlatform.ios,
  +        buildMode: BuildMode.release,
  +        mainPath: 'main.dill',
  +        packagesPath: '.packages',
  +        outputPath: outputPath,
  +        buildSharedLibrary: false,
  +        previewDart2: true,
  +        iosArch: IOSArch.armv7,
  +      );
  +
  +      expect(genSnapshotExitCode, 0);
  +      expect(genSnapshot.callCount, 1);
  +      expect(genSnapshot.snapshotType.platform, TargetPlatform.ios);
  +      expect(genSnapshot.snapshotType.mode, BuildMode.release);
  +      expect(genSnapshot.packagesPath, '.packages');
  +      expect(genSnapshot.additionalArgs, <String>[
  +        '--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
  +        '--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
  +        '--embedder_entry_points_manifest=$kVmEntrypoints',
  +        '--embedder_entry_points_manifest=$kIoEntries',
  +        '--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
  +        '--reify-generic-functions',
  +        '--strong',
  +        '--snapshot_kind=app-aot-assembly',
  +        '--assembly=${fs.path.join(outputPath, 'snapshot_assembly.S')}',
  +        '--no-sim-use-hardfp',
  +        '--no-use-integer-division',
  +        'main.dill',
  +      ]);
  +    }, overrides: contextOverrides);
  +
  +    testUsingContext('builds iOS release arm64 AOT snapshot', () async {
         fs.file('main.dill').writeAsStringSync('binary magic');
   
         final String outputPath = fs.path.join('build', 'foo');
  
positive.code:       mockArtifacts = new MockArtifacts();
        mockXcode = new MockXcode();
        for (BuildMode mode in BuildMode.values) {
          when(mockArtifacts.getArtifactPath(Artifact.dartVmEntryPointsTxt, TargetPlatform.ios, mode)).thenReturn(kVmEntrypoints);
          when(mockArtifacts.getArtifactPath(Artifact.dartIoEntriesTxt, TargetPlatform.ios, mode)).thenReturn(kIoEntries);
          when(mockArtifacts.getArtifactPath(Artifact.snapshotDart, TargetPlatform.ios, mode)).thenReturn(kSnapshotDart);
          when(mockArtifacts.getArtifactPath(Artifact.entryPointsJson, TargetPlatform.ios, mode)).thenReturn(kEntrypointsJson);
          when(mockArtifacts.getArtifactPath(Artifact.entryPointsExtraJson, TargetPlatform.ios, mode)).thenReturn(kEntrypointsExtraJson);
        }
      });
  
  
negative.code:       expect(genSnapshotExitCode, isNot(0));
        expect(genSnapshot.callCount, 0);
      }, overrides: contextOverrides);
  
      testUsingContext('builds Android arm release AOT snapshot', () async {
        fs.file('main.dill').writeAsStringSync('binary magic');
  
        final String outputPath = fs.path.join('build', 'foo');
        fs.directory(outputPath).createSync(recursive: true);
  
        genSnapshot.outputs = <String, String>{
          fs.path.join(outputPath, 'vm_snapshot_data'): '',
          fs.path.join(outputPath, 'isolate_snapshot_data'): '',
          fs.path.join(outputPath, 'vm_snapshot_instr'): '',
          fs.path.join(outputPath, 'isolate_snapshot_instr'): '',
          fs.path.join(outputPath, 'snapshot.d'): '${fs.path.join(outputPath, 'vm_snapshot_data')} : ',
        };
  
        final RunResult successResult = new RunResult(new ProcessResult(1, 0, '', ''));
        when(xcode.cc(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
        when(xcode.clang(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  
        final int genSnapshotExitCode = await snapshotter.build(
          platform: TargetPlatform.android_arm,
          buildMode: BuildMode.release,
          mainPath: 'main.dill',
          packagesPath: '.packages',
          outputPath: outputPath,
          buildSharedLibrary: false,
          previewDart2: true,
        );
  
        expect(genSnapshotExitCode, 0);
        expect(genSnapshot.callCount, 1);
        expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm);
        expect(genSnapshot.snapshotType.mode, BuildMode.release);
        expect(genSnapshot.packagesPath, '.packages');
        expect(genSnapshot.additionalArgs, <String>[
          '--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
          '--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
          '--embedder_entry_points_manifest=$kVmEntrypoints',
          '--embedder_entry_points_manifest=$kIoEntries',
          '--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
          '--reify-generic-functions',
          '--strong',
          '--snapshot_kind=app-aot-blobs',
          '--vm_snapshot_data=build/foo/vm_snapshot_data',
          '--isolate_snapshot_data=build/foo/isolate_snapshot_data',
          '--vm_snapshot_instructions=build/foo/vm_snapshot_instr',
          '--isolate_snapshot_instructions=build/foo/isolate_snapshot_instr',
          '--no-sim-use-hardfp',
          '--no-use-integer-division',
          'main.dill',
        ]);
      }, overrides: contextOverrides);
  
      testUsingContext('builds Android arm64 release AOT snapshot', () async {
        fs.file('main.dill').writeAsStringSync('binary magic');
  
        final String outputPath = fs.path.join('build', 'foo');
        fs.directory(outputPath).createSync(recursive: true);
  
        genSnapshot.outputs = <String, String>{
          fs.path.join(outputPath, 'vm_snapshot_data'): '',
          fs.path.join(outputPath, 'isolate_snapshot_data'): '',
          fs.path.join(outputPath, 'vm_snapshot_instr'): '',
          fs.path.join(outputPath, 'isolate_snapshot_instr'): '',
          fs.path.join(outputPath, 'snapshot.d'): '${fs.path.join(outputPath, 'vm_snapshot_data')} : ',
        };
  
        final RunResult successResult = new RunResult(new ProcessResult(1, 0, '', ''));
        when(xcode.cc(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
        when(xcode.clang(any)).thenAnswer((_) => new Future<RunResult>.value(successResult));
  
        final int genSnapshotExitCode = await snapshotter.build(
          platform: TargetPlatform.android_arm64,
          buildMode: BuildMode.release,
          mainPath: 'main.dill',
          packagesPath: '.packages',
          outputPath: outputPath,
          buildSharedLibrary: false,
          previewDart2: true,
        );
  
        expect(genSnapshotExitCode, 0);
        expect(genSnapshot.callCount, 1);
        expect(genSnapshot.snapshotType.platform, TargetPlatform.android_arm64);
        expect(genSnapshot.snapshotType.mode, BuildMode.release);
        expect(genSnapshot.packagesPath, '.packages');
        expect(genSnapshot.additionalArgs, <String>[
          '--url_mapping=dart:ui,${fs.path.join(skyEnginePath, 'lib', 'ui', 'ui.dart')}',
          '--url_mapping=dart:vmservice_io,${fs.path.join(skyEnginePath, 'sdk_ext', 'vmservice_io.dart')}',
          '--embedder_entry_points_manifest=$kVmEntrypoints',
          '--embedder_entry_points_manifest=$kIoEntries',
          '--dependencies=${fs.path.join(outputPath, 'snapshot.d')}',
          '--reify-generic-functions',
          '--strong',
          '--snapshot_kind=app-aot-blobs',
          '--vm_snapshot_data=build/foo/vm_snapshot_data',
          '--isolate_snapshot_data=build/foo/isolate_snapshot_data',
          '--vm_snapshot_instructions=build/foo/vm_snapshot_instr',
          '--isolate_snapshot_instructions=build/foo/isolate_snapshot_instr',
          'main.dill',
        ]);
      }, overrides: contextOverrides);
  
    });
  }
  