@@ -551,6 +551,40 @@ void testMain() {
551551 expect (spy.messages, isEmpty);
552552 });
553553
554+ test ('setClient, setEditingState, setSizeAndTransform, show - input element is put into the DOM' , () {
555+ editingStrategy = SafariDesktopTextEditingStrategy (textEditing! );
556+ textEditing! .debugTextEditingStrategyOverride = editingStrategy;
557+ final MethodCall setClient = MethodCall (
558+ 'TextInput.setClient' , < dynamic > [123 , flutterSinglelineConfig]);
559+ sendFrameworkMessage (codec.encodeMethodCall (setClient));
560+
561+ const MethodCall setEditingState =
562+ MethodCall ('TextInput.setEditingState' , < String , dynamic > {
563+ 'text' : 'abcd' ,
564+ 'selectionBase' : 2 ,
565+ 'selectionExtent' : 3 ,
566+ });
567+ sendFrameworkMessage (codec.encodeMethodCall (setEditingState));
568+
569+ // Editing shouldn't have started yet.
570+ expect (document.activeElement, document.body);
571+
572+ // The "setSizeAndTransform" message has to be here before we call
573+ // checkInputEditingState, since on some platforms (e.g. Desktop Safari)
574+ // we don't put the input element into the DOM until we get its correct
575+ // dimensions from the framework.
576+ final MethodCall setSizeAndTransform =
577+ configureSetSizeAndTransformMethodCall (150 , 50 ,
578+ Matrix4 .translationValues (10.0 , 20.0 , 30.0 ).storage.toList ());
579+ sendFrameworkMessage (codec.encodeMethodCall (setSizeAndTransform));
580+
581+ const MethodCall show = MethodCall ('TextInput.show' );
582+ sendFrameworkMessage (codec.encodeMethodCall (show));
583+
584+ expect (defaultTextEditingRoot.activeElement,
585+ textEditing! .strategy.domElement);
586+ });
587+
554588 test ('setClient, setEditingState, show, updateConfig, clearClient' , () {
555589 final MethodCall setClient = MethodCall ('TextInput.setClient' , < dynamic > [
556590 123 ,
0 commit comments