@@ -760,7 +760,7 @@ void main() {
760
760
final Cache cache = Cache .test (processManager: FakeProcessManager .any (), fileSystem: fileSystem);
761
761
final Directory webCacheDirectory = cache.getWebSdkDirectory ();
762
762
final FakeArtifactUpdater artifactUpdater = FakeArtifactUpdater ();
763
- final FlutterWebSdk webSdk = FlutterWebSdk (cache, platform : FakePlatform () );
763
+ final FlutterWebSdk webSdk = FlutterWebSdk (cache);
764
764
765
765
final List <String > messages = < String > [];
766
766
final List <String > downloads = < String > [];
@@ -778,17 +778,14 @@ void main() {
778
778
779
779
expect (messages, < String > [
780
780
'Downloading Web SDK...' ,
781
- 'Downloading CanvasKit...' ,
782
781
]);
783
782
784
783
expect (downloads, < String > [
785
- 'https://storage.googleapis.com/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk-linux-x64.zip' ,
786
- 'https://chrome-infra-packages.appspot.com/dl/flutter/web/canvaskit_bundle/+/abcdefg' ,
784
+ 'https://storage.googleapis.com/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk.zip' ,
787
785
]);
788
786
789
787
expect (locations, < String > [
790
788
'cache/bin/cache/flutter_web_sdk' ,
791
- 'cache/bin/cache/flutter_web_sdk' ,
792
789
]);
793
790
794
791
expect (webCacheDirectory.childFile ('foo' ), exists);
@@ -820,7 +817,7 @@ void main() {
820
817
);
821
818
final Directory webCacheDirectory = cache.getWebSdkDirectory ();
822
819
final FakeArtifactUpdater artifactUpdater = FakeArtifactUpdater ();
823
- final FlutterWebSdk webSdk = FlutterWebSdk (cache, platform : FakePlatform () );
820
+ final FlutterWebSdk webSdk = FlutterWebSdk (cache);
824
821
825
822
final List <String > downloads = < String > [];
826
823
final List <String > locations = < String > [];
@@ -835,57 +832,7 @@ void main() {
835
832
await webSdk.updateInner (artifactUpdater, fileSystem, FakeOperatingSystemUtils ());
836
833
837
834
expect (downloads, < String > [
838
- 'https://flutter.storage.com/override/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk-linux-x64.zip' ,
839
- 'https://flutter.storage.com/override/flutter_infra_release/cipd/flutter/web/canvaskit_bundle/+/abcdefg' ,
840
- ]);
841
- });
842
-
843
- testWithoutContext ('FlutterWebSdk does not download CanvasKit if it is already in flutter_web_sdk' , () async {
844
- final MemoryFileSystem fileSystem = MemoryFileSystem .test ();
845
- final Directory internalDir = fileSystem.currentDirectory
846
- .childDirectory ('cache' )
847
- .childDirectory ('bin' )
848
- .childDirectory ('internal' );
849
- final File canvasKitVersionFile = internalDir.childFile ('canvaskit.version' );
850
- canvasKitVersionFile.createSync (recursive: true );
851
- canvasKitVersionFile.writeAsStringSync ('abcdefg' );
852
-
853
- final File engineVersionFile = internalDir.childFile ('engine.version' );
854
- engineVersionFile.createSync (recursive: true );
855
- engineVersionFile.writeAsStringSync ('hijklmnop' );
856
-
857
- final Cache cache = Cache .test (processManager: FakeProcessManager .any (), fileSystem: fileSystem);
858
- final FakeArtifactUpdater artifactUpdater = FakeArtifactUpdater ();
859
- final FlutterWebSdk webSdk = FlutterWebSdk (cache, platform: FakePlatform ());
860
-
861
- final List <String > messages = < String > [];
862
- final List <String > downloads = < String > [];
863
- final List <String > locations = < String > [];
864
- artifactUpdater.onDownloadZipArchive = (String message, Uri uri, Directory location) {
865
- messages.add (message);
866
- downloads.add (uri.toString ());
867
- locations.add (location.path);
868
- location.createSync (recursive: true );
869
- location.childDirectory ('canvaskit' ).createSync ();
870
- location.childDirectory ('canvaskit' ).childFile ('canvaskit.js' ).createSync ();
871
- location.childDirectory ('canvaskit' ).childFile ('canvaskit.wasm' ).createSync ();
872
- location.childDirectory ('canvaskit' ).childDirectory ('profiling' ).createSync ();
873
- location.childDirectory ('canvaskit' ).childDirectory ('profiling' ).childFile ('canvaskit.js' ).createSync ();
874
- location.childDirectory ('canvaskit' ).childDirectory ('profiling' ).childFile ('canvaskit.wasm' ).createSync ();
875
- };
876
-
877
- await webSdk.updateInner (artifactUpdater, fileSystem, FakeOperatingSystemUtils ());
878
-
879
- expect (messages, < String > [
880
- 'Downloading Web SDK...' ,
881
- ]);
882
-
883
- expect (downloads, < String > [
884
- 'https://storage.googleapis.com/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk-linux-x64.zip' ,
885
- ]);
886
-
887
- expect (locations, < String > [
888
- 'cache/bin/cache/flutter_web_sdk' ,
835
+ 'https://flutter.storage.com/override/flutter_infra_release/flutter/hijklmnop/flutter-web-sdk.zip' ,
889
836
]);
890
837
});
891
838
@@ -895,7 +842,7 @@ void main() {
895
842
final Cache cache = Cache .test (processManager: FakeProcessManager .any (), fileSystem: fileSystem);
896
843
final Directory webCacheDirectory = cache.getWebSdkDirectory ();
897
844
final FakeArtifactUpdater artifactUpdater = FakeArtifactUpdater ();
898
- final FlutterWebSdk webSdk = FlutterWebSdk (cache, platform : FakePlatform () );
845
+ final FlutterWebSdk webSdk = FlutterWebSdk (cache);
899
846
900
847
artifactUpdater.onDownloadZipArchive = (String message, Uri uri, Directory location) {
901
848
location.createSync (recursive: true );
0 commit comments