@@ -217,6 +217,78 @@ void main() {
217217 expect (assetDirectory.childFile ('isolate_snapshot_data' ), exists);
218218 expect (assetDirectory.childFile ('io.flutter.shaders.json' ), exists);
219219 expect (assetDirectory.childFile ('io.flutter.shaders.json' ).readAsStringSync (), '{"data":{"A":"B"}}' );
220+ }, overrides: < Type , Generator > {
221+ FileSystem : () => fileSystem,
222+ ProcessManager : () => processManager,
223+ Platform : () => macPlatform,
224+ });
225+
226+ testUsingContext ('DebugIosApplicationBundle with impeller and shader compilation' , () async {
227+ // Create impellerc to work around fallback detection logic.
228+ fileSystem.file (artifacts.getHostArtifact (HostArtifact .impellerc)).createSync (recursive: true );
229+
230+ environment.defines[kBuildMode] = 'debug' ;
231+ environment.defines[kCodesignIdentity] = 'ABC123' ;
232+ // Precompiled dart data
233+
234+ fileSystem.file (artifacts.getArtifactPath (Artifact .vmSnapshotData, mode: BuildMode .debug))
235+ .createSync ();
236+ fileSystem.file (artifacts.getArtifactPath (Artifact .isolateSnapshotData, mode: BuildMode .debug))
237+ .createSync ();
238+ // Project info
239+ fileSystem.file ('pubspec.yaml' ).writeAsStringSync ('name: hello\n flutter:\n shaders:\n - shader.glsl' );
240+ fileSystem.file ('.packages' ).writeAsStringSync ('\n ' );
241+ // Plist file
242+ fileSystem.file (fileSystem.path.join ('ios' , 'Flutter' , 'AppFrameworkInfo.plist' ))
243+ .createSync (recursive: true );
244+ // Shader file
245+ fileSystem.file ('shader.glsl' ).writeAsStringSync ('test' );
246+ // App kernel
247+ environment.buildDir.childFile ('app.dill' ).createSync (recursive: true );
248+ // Stub framework
249+ environment.buildDir
250+ .childDirectory ('App.framework' )
251+ .childFile ('App' )
252+ .createSync (recursive: true );
253+
254+ final Directory frameworkDirectory = environment.outputDir.childDirectory ('App.framework' );
255+ final File frameworkDirectoryBinary = frameworkDirectory.childFile ('App' );
256+ processManager.addCommands (< FakeCommand > [
257+ const FakeCommand (command: < String > [
258+ 'HostArtifact.impellerc' ,
259+ '--runtime-stage-metal' ,
260+ '--iplr' ,
261+ '--sl=/App.framework/flutter_assets/shader.glsl' ,
262+ '--spirv=/App.framework/flutter_assets/shader.glsl.spirv' ,
263+ '--input=/shader.glsl' ,
264+ '--input-type=frag' ,
265+ '--include=/'
266+ ]),
267+ FakeCommand (command: < String > [
268+ 'codesign' ,
269+ '--force' ,
270+ '--sign' ,
271+ 'ABC123' ,
272+ '--timestamp=none' ,
273+ frameworkDirectoryBinary.path,
274+ ]),
275+ ]);
276+
277+ await const DebugIosApplicationBundle ().build (environment);
278+ expect (processManager, hasNoRemainingExpectations);
279+
280+ expect (frameworkDirectoryBinary, exists);
281+ expect (frameworkDirectory.childFile ('Info.plist' ), exists);
282+
283+ final Directory assetDirectory = frameworkDirectory.childDirectory ('flutter_assets' );
284+ expect (assetDirectory.childFile ('kernel_blob.bin' ), exists);
285+ expect (assetDirectory.childFile ('AssetManifest.json' ), exists);
286+ expect (assetDirectory.childFile ('vm_snapshot_data' ), exists);
287+ expect (assetDirectory.childFile ('isolate_snapshot_data' ), exists);
288+ }, overrides: < Type , Generator > {
289+ FileSystem : () => fileSystem,
290+ ProcessManager : () => processManager,
291+ Platform : () => macPlatform,
220292 });
221293
222294 testUsingContext ('ReleaseIosApplicationBundle build' , () async {
0 commit comments