@@ -1016,7 +1016,7 @@ void testMain() {
1016
1016
1017
1017
test (
1018
1018
'singleTextField Autofill: setClient, setEditingState, show, '
1019
- 'setEditingState, clearClient' , () {
1019
+ 'setSizeAndTransform, setEditingState, clearClient' , () {
1020
1020
// Create a configuration with focused element has autofil hint.
1021
1021
final Map <String , dynamic > flutterSingleAutofillElementConfig =
1022
1022
createFlutterConfig ('text' , autofillHint: 'username' );
@@ -1035,6 +1035,11 @@ void testMain() {
1035
1035
const MethodCall show = MethodCall ('TextInput.show' );
1036
1036
sendFrameworkMessage (codec.encodeMethodCall (show));
1037
1037
1038
+ final MethodCall setSizeAndTransform =
1039
+ configureSetSizeAndTransformMethodCall (150 , 50 ,
1040
+ Matrix4 .translationValues (10.0 , 20.0 , 30.0 ).storage.toList ());
1041
+ sendFrameworkMessage (codec.encodeMethodCall (setSizeAndTransform));
1042
+
1038
1043
// The second [setEditingState] should override the first one.
1039
1044
checkInputEditingState (
1040
1045
textEditing.editingElement.domElement, 'abcd' , 2 , 3 );
@@ -1074,9 +1079,18 @@ void testMain() {
1074
1079
const MethodCall show = MethodCall ('TextInput.show' );
1075
1080
sendFrameworkMessage (codec.encodeMethodCall (show));
1076
1081
1077
- // The second [setEditingState] should override the first one.
1078
- checkInputEditingState (
1079
- textEditing.editingElement.domElement, 'abcd' , 2 , 3 );
1082
+ final InputElement inputElement =
1083
+ textEditing.editingElement.domElement as InputElement ;
1084
+ expect (inputElement.value, 'abcd' );
1085
+ if (! (browserEngine == BrowserEngine .webkit &&
1086
+ operatingSystem == OperatingSystem .macOs)) {
1087
+ // In Safari Desktop Autofill menu appears as soon as an element is
1088
+ // focused, therefore the input element is only focused after the
1089
+ // location is received.
1090
+ expect (document.activeElement, inputElement);
1091
+ expect (inputElement.selectionStart, 2 );
1092
+ expect (inputElement.selectionEnd, 3 );
1093
+ }
1080
1094
1081
1095
// The transform is changed. For example after a validation error, red
1082
1096
// line appeared under the input field.
@@ -1104,7 +1118,7 @@ void testMain() {
1104
1118
1105
1119
test (
1106
1120
'multiTextField Autofill: setClient, setEditingState, show, '
1107
- 'setEditingState, clearClient' , () {
1121
+ 'setSizeAndTransform setEditingState, clearClient' , () {
1108
1122
// Create a configuration with an AutofillGroup of four text fields.
1109
1123
final Map <String , dynamic > flutterMultiAutofillElementConfig =
1110
1124
createFlutterConfig ('text' ,
@@ -1130,6 +1144,11 @@ void testMain() {
1130
1144
const MethodCall show = MethodCall ('TextInput.show' );
1131
1145
sendFrameworkMessage (codec.encodeMethodCall (show));
1132
1146
1147
+ final MethodCall setSizeAndTransform =
1148
+ configureSetSizeAndTransformMethodCall (150 , 50 ,
1149
+ Matrix4 .translationValues (10.0 , 20.0 , 30.0 ).storage.toList ());
1150
+ sendFrameworkMessage (codec.encodeMethodCall (setSizeAndTransform));
1151
+
1133
1152
// The second [setEditingState] should override the first one.
1134
1153
checkInputEditingState (
1135
1154
textEditing.editingElement.domElement, 'abcd' , 2 , 3 );
@@ -1502,6 +1521,11 @@ void testMain() {
1502
1521
const MethodCall show = MethodCall ('TextInput.show' );
1503
1522
sendFrameworkMessage (codec.encodeMethodCall (show));
1504
1523
1524
+ final MethodCall setSizeAndTransform =
1525
+ configureSetSizeAndTransformMethodCall (150 , 50 ,
1526
+ Matrix4 .translationValues (10.0 , 20.0 , 30.0 ).storage.toList ());
1527
+ sendFrameworkMessage (codec.encodeMethodCall (setSizeAndTransform));
1528
+
1505
1529
// The second [setEditingState] should override the first one.
1506
1530
checkInputEditingState (
1507
1531
textEditing.editingElement.domElement, 'abcd' , 2 , 3 );
0 commit comments