anchor.diff:    @override
     String stampName = 'ios-usb';
   }
  -class MockCache extends Mock implements Cache {}
  +
  +class FakeSecondaryCache extends Fake implements Cache {
  +  Directory downloadDir;
  +  Directory artifactDirectory;
  +  String version;
  +  void Function(String artifactName, String version) onSetStamp;
  +
  +  @override
  +  String get storageBaseUrl => 'https://storage.googleapis.com';
  +
  +  @override
  +  Directory getDownloadDir() => artifactDirectory;
  +
  +  @override
  +  Directory getArtifactDirectory(String name) => artifactDirectory;
  +
  +  @override
  +  Directory getCacheDir(String name) {
  +    return artifactDirectory.childDirectory(name);
  +  }
  +
  +  @override
  +  File getLicenseFile() {
  +    return artifactDirectory.childFile('LICENSE');
  +  }
  +
  +  @override
  +  String getVersionFor(String artifactName) => version;
  +
  +  @override
  +  void setStampFor(String artifactName, String version) {
  +    onSetStamp(artifactName, version);
  +  }
  +}
   
   class FakeVersionedPackageResolver extends Fake implements VersionedPackageResolver {
     final List<List<String>> resolved = <List<String>>[];
  
positive.code: 
    testWithoutContext('EngineCachedArtifact removes unzipped FlutterMacOS.framework before replacing', () async {
      final OperatingSystemUtils operatingSystemUtils = FakeOperatingSystemUtils();
      final MockCache cache = MockCache();
      final FileSystem fileSystem = MemoryFileSystem.test();
      final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
      final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
  
      when(cache.getArtifactDirectory(any)).thenReturn(artifactDir);
      when(cache.getDownloadDir()).thenReturn(downloadDir);
      final Directory binDir = artifactDir.childDirectory('bin_dir')..createSync();
      binDir.childFile('FlutterMacOS.framework.zip').createSync();
      final Directory unzippedFramework = binDir.childDirectory('FlutterMacOS.framework');
  
negative.code:     testWithoutContext('Continues on failed stamp file update', () async {
        final FileSystem fileSystem = MemoryFileSystem.test();
        final BufferLogger logger = BufferLogger.test();
        final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
        final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
        final Cache cache = FakeSecondaryCache()
          ..version = 'asdasd'
          ..artifactDirectory = artifactDir
          ..downloadDir = downloadDir
          ..onSetStamp = (String name, String version) {
            throw const FileSystemException('stamp write failed');
          };
  
        final FakeSimpleArtifact artifact = FakeSimpleArtifact(cache);
        await artifact.update(FakeArtifactUpdater(), logger, fileSystem, FakeOperatingSystemUtils());
  
        expect(logger.errorText, contains('stamp write failed'));
  