@@ -33,14 +33,10 @@ void main() {
33
33
late Platform platform;
34
34
35
35
setUp (() async {
36
- testFileSystem = MemoryFileSystem (
37
- style: globals.platform.isWindows
38
- ? FileSystemStyle .windows
39
- : FileSystemStyle .posix,
40
- );
36
+ testFileSystem = MemoryFileSystem ();
41
37
testFileSystem.currentDirectory = testFileSystem.systemTempDirectory.createTempSync ('flutter_asset_bundle_test.' );
42
38
logger = BufferLogger .test ();
43
- platform = FakePlatform (operatingSystem : globals.platform.operatingSystem );
39
+ platform = FakePlatform ();
44
40
});
45
41
46
42
testUsingContext ('nonempty' , () async {
@@ -49,6 +45,7 @@ void main() {
49
45
expect (ab.entries.length, greaterThan (0 ));
50
46
}, overrides: < Type , Generator > {
51
47
FileSystem : () => testFileSystem,
48
+ Platform : () => platform,
52
49
ProcessManager : () => FakeProcessManager .any (),
53
50
});
54
51
@@ -75,6 +72,7 @@ void main() {
75
72
76
73
}, overrides: < Type , Generator > {
77
74
FileSystem : () => testFileSystem,
75
+ Platform : () => platform,
78
76
ProcessManager : () => FakeProcessManager .any (),
79
77
});
80
78
@@ -120,6 +118,7 @@ flutter:
120
118
]));
121
119
}, overrides: < Type , Generator > {
122
120
FileSystem : () => testFileSystem,
121
+ Platform : () => platform,
123
122
ProcessManager : () => FakeProcessManager .any (),
124
123
});
125
124
@@ -150,6 +149,7 @@ flutter:
150
149
'assets/foo/fizz.txt' ]));
151
150
}, overrides: < Type , Generator > {
152
151
FileSystem : () => testFileSystem,
152
+ Platform : () => platform,
153
153
ProcessManager : () => FakeProcessManager .any (),
154
154
});
155
155
@@ -192,6 +192,7 @@ name: example''')
192
192
'AssetManifest.bin' , 'FontManifest.json' , 'NOTICES.Z' , 'assets/foo/bar.txt' ]));
193
193
}, overrides: < Type , Generator > {
194
194
FileSystem : () => testFileSystem,
195
+ Platform : () => platform,
195
196
ProcessManager : () => FakeProcessManager .any (),
196
197
});
197
198
@@ -217,6 +218,7 @@ flutter:
217
218
expect (bundle.needsBuild (), false );
218
219
}, overrides: < Type , Generator > {
219
220
FileSystem : () => testFileSystem,
221
+ Platform : () => platform,
220
222
ProcessManager : () => FakeProcessManager .any (),
221
223
});
222
224
@@ -252,6 +254,7 @@ flutter:
252
254
expect (bundle.needsBuild (), false );
253
255
}, overrides: < Type , Generator > {
254
256
FileSystem : () => testFileSystem,
257
+ Platform : () => platform,
255
258
ProcessManager : () => FakeProcessManager .any (),
256
259
});
257
260
@@ -282,6 +285,7 @@ flutter:
282
285
expect (bundle.needsBuild (), false );
283
286
}, overrides: < Type , Generator > {
284
287
FileSystem : () => testFileSystem,
288
+ Platform : () => platform,
285
289
ProcessManager : () => FakeProcessManager .any (),
286
290
});
287
291
@@ -330,6 +334,7 @@ flutter:
330
334
expect (bundle.deferredComponentsEntries['component1' ]! .length, 3 );
331
335
}, overrides: < Type , Generator > {
332
336
FileSystem : () => testFileSystem,
337
+ Platform : () => platform,
333
338
ProcessManager : () => FakeProcessManager .any (),
334
339
});
335
340
@@ -515,14 +520,12 @@ flutter:
515
520
516
521
group ('AssetBundle.build (web builds)' , () {
517
522
late FileSystem testFileSystem;
523
+ late Platform testPlatform;
518
524
519
525
setUp (() async {
520
- testFileSystem = MemoryFileSystem (
521
- style: globals.platform.isWindows
522
- ? FileSystemStyle .windows
523
- : FileSystemStyle .posix,
524
- );
526
+ testFileSystem = MemoryFileSystem ();
525
527
testFileSystem.currentDirectory = testFileSystem.systemTempDirectory.createTempSync ('flutter_asset_bundle_test.' );
528
+ testPlatform = FakePlatform ();
526
529
});
527
530
528
531
testUsingContext ('empty pubspec' , () async {
@@ -550,6 +553,7 @@ flutter:
550
553
);
551
554
}, overrides: < Type , Generator > {
552
555
FileSystem : () => testFileSystem,
556
+ Platform : () => testPlatform,
553
557
ProcessManager : () => FakeProcessManager .any (),
554
558
});
555
559
@@ -605,6 +609,7 @@ flutter:
605
609
reason: 'JSON-encoded binary content should be identical to BIN file.' );
606
610
}, overrides: < Type , Generator > {
607
611
FileSystem : () => testFileSystem,
612
+ Platform : () => testPlatform,
608
613
ProcessManager : () => FakeProcessManager .any (),
609
614
});
610
615
});
@@ -657,6 +662,7 @@ assets:
657
662
expect (license, bundle.entries['NOTICES' ]);
658
663
}, overrides: < Type , Generator > {
659
664
FileSystem : () => MemoryFileSystem .test (),
665
+ Platform : () => FakePlatform (),
660
666
ProcessManager : () => FakeProcessManager .any (),
661
667
});
662
668
@@ -678,6 +684,7 @@ flutter:
678
684
expect (bundle.additionalDependencies.single.path, contains ('DOES_NOT_EXIST_RERUN_FOR_WILDCARD' ));
679
685
}, overrides: < Type , Generator > {
680
686
FileSystem : () => MemoryFileSystem .test (),
687
+ Platform : () => FakePlatform (),
681
688
ProcessManager : () => FakeProcessManager .any (),
682
689
});
683
690
@@ -699,6 +706,7 @@ flutter:
699
706
expect (bundle.additionalDependencies, isEmpty);
700
707
}, overrides: < Type , Generator > {
701
708
FileSystem : () => MemoryFileSystem .test (),
709
+ Platform : () => FakePlatform (),
702
710
ProcessManager : () => FakeProcessManager .any (),
703
711
});
704
712
0 commit comments