Revert "Lazy cache 4 (#29785)" (#29985)
diff --git a/packages/flutter_tools/test/cache_test.dart b/packages/flutter_tools/test/cache_test.dart
index cb75ede..1e7916f 100644
--- a/packages/flutter_tools/test/cache_test.dart
+++ b/packages/flutter_tools/test/cache_test.dart
@@ -84,34 +84,34 @@
test('should not be up to date, if some cached artifact is not', () {
final CachedArtifact artifact1 = MockCachedArtifact();
final CachedArtifact artifact2 = MockCachedArtifact();
- when(artifact1.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(true);
- when(artifact2.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(false);
+ when(artifact1.isUpToDate()).thenReturn(true);
+ when(artifact2.isUpToDate()).thenReturn(false);
final Cache cache = Cache(artifacts: <CachedArtifact>[artifact1, artifact2]);
- expect(cache.isUpToDate(const <DevelopmentArtifact>{}), isFalse);
+ expect(cache.isUpToDate(), isFalse);
});
test('should be up to date, if all cached artifacts are', () {
final CachedArtifact artifact1 = MockCachedArtifact();
final CachedArtifact artifact2 = MockCachedArtifact();
- when(artifact1.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(true);
- when(artifact2.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(true);
+ when(artifact1.isUpToDate()).thenReturn(true);
+ when(artifact2.isUpToDate()).thenReturn(true);
final Cache cache = Cache(artifacts: <CachedArtifact>[artifact1, artifact2]);
- expect(cache.isUpToDate(const <DevelopmentArtifact>{}), isTrue);
+ expect(cache.isUpToDate(), isTrue);
});
test('should update cached artifacts which are not up to date', () async {
final CachedArtifact artifact1 = MockCachedArtifact();
final CachedArtifact artifact2 = MockCachedArtifact();
- when(artifact1.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(true);
- when(artifact2.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(false);
+ when(artifact1.isUpToDate()).thenReturn(true);
+ when(artifact2.isUpToDate()).thenReturn(false);
final Cache cache = Cache(artifacts: <CachedArtifact>[artifact1, artifact2]);
- await cache.updateAll(const <DevelopmentArtifact>{});
+ await cache.updateAll();
verifyNever(artifact1.update());
verify(artifact2.update());
});
testUsingContext('failed storage.googleapis.com download shows China warning', () async {
final CachedArtifact artifact1 = MockCachedArtifact();
final CachedArtifact artifact2 = MockCachedArtifact();
- when(artifact1.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(false);
- when(artifact2.isUpToDate(const <DevelopmentArtifact>{})).thenReturn(false);
+ when(artifact1.isUpToDate()).thenReturn(false);
+ when(artifact2.isUpToDate()).thenReturn(false);
final MockInternetAddress address = MockInternetAddress();
when(address.host).thenReturn('storage.googleapis.com');
when(artifact1.update()).thenThrow(SocketException(
@@ -120,7 +120,7 @@
));
final Cache cache = Cache(artifacts: <CachedArtifact>[artifact1, artifact2]);
try {
- await cache.updateAll(const <DevelopmentArtifact>{});
+ await cache.updateAll();
fail('Mock thrown exception expected');
} catch (e) {
verify(artifact1.update());