@@ -583,41 +583,47 @@ void main() {
583583 await dispose (tester);
584584 });
585585
586- testWidgets ('Word retains the byte picker with mobile PDF enabled' , (
587- tester,
588- ) async {
589- await Settings .setValue <int >('key-print-destination' , 1 );
590- final output = File ('${directory .path }/mobile-output.docx' );
591- final previousOwner = DialogOwner .hwnd ();
592- DialogOwner .mainWindowHwnd = 101 ;
593- addTearDown (() => DialogOwner .mainWindowHwnd = previousOwner);
594- picker.saveWord = (fileName, bytes) async {
595- expect (fileName, 'mobile-output.docx' );
596- await output.writeAsBytes (bytes);
597- return output.uri;
598- };
599- if (Platform .isMacOS) {
600- const channel = MethodChannel ('miguelruivo.flutter.plugins.filepicker' );
601- final messenger =
602- TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger;
603- messenger.setMockMethodCallHandler (channel, (call) async {
604- expect (call.method, 'save' );
605- expect (call.arguments['fileName' ], 'mobile-output.docx' );
606- return output.path;
607- });
608- addTearDown (() => messenger.setMockMethodCallHandler (channel, null ));
609- }
586+ testWidgets (
587+ 'Word retains the byte picker with mobile PDF enabled' ,
588+ (
589+ tester,
590+ ) async {
591+ await Settings .setValue <int >('key-print-destination' , 1 );
592+ final output = File ('${directory .path }/mobile-output.docx' );
593+ final previousOwner = DialogOwner .hwnd ();
594+ DialogOwner .mainWindowHwnd = 101 ;
595+ addTearDown (() => DialogOwner .mainWindowHwnd = previousOwner);
596+ picker.saveWord = (fileName, bytes) async {
597+ expect (fileName, 'mobile-output.docx' );
598+ await output.writeAsBytes (bytes);
599+ return output.uri;
600+ };
601+ if (Platform .isMacOS) {
602+ const channel = MethodChannel ('miguelruivo.flutter.plugins.filepicker' );
603+ final messenger =
604+ TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger;
605+ messenger.setMockMethodCallHandler (channel, (call) async {
606+ expect (call.method, 'save' );
607+ expect (call.arguments['fileName' ], 'mobile-output.docx' );
608+ return output.path;
609+ });
610+ addTearDown (() => messenger.setMockMethodCallHandler (channel, null ));
611+ }
610612
611- await open (tester, text: true );
612- expect (find.text ('שמור ל-Word' ), findsOneWidget);
613- await tester.tap (find.text ('שמירה' ));
614- await _waitFor (tester, () => closed);
615- expect (saved, isTrue);
616- expect (backend.requests, isEmpty);
617- final document = ZipDecoder ().decodeBytes (output.readAsBytesSync ());
618- expect (document.findFile ('word/document.xml' ), isNotNull);
619- await dispose (tester);
620- });
613+ await open (tester, text: true );
614+ expect (find.text ('שמור ל-Word' ), findsOneWidget);
615+ await tester.tap (find.text ('שמירה' ));
616+ await _waitFor (tester, () => closed);
617+ expect (saved, isTrue);
618+ expect (backend.requests, isEmpty);
619+ final document = ZipDecoder ().decodeBytes (output.readAsBytesSync ());
620+ expect (document.findFile ('word/document.xml' ), isNotNull);
621+ await dispose (tester);
622+ },
623+ variant: TargetPlatformVariant .only (
624+ Platform .isMacOS ? TargetPlatform .macOS : TargetPlatform .android,
625+ ),
626+ );
621627
622628 for (final (name, seed, brightness) in [
623629 ('light' , AppSeedColors .defaultLight, Brightness .light),
0 commit comments