Skip to content

Commit

Permalink
Fixing the editable_text unit tests by clearing the log. Add a modifi…
Browse files Browse the repository at this point in the history
…cation for also testing cached size. (#41300)
  • Loading branch information
nturgut committed Sep 25, 2019
1 parent 9c6dd0d commit ae529d8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/flutter/test/widgets/editable_text_test.dart
Expand Up @@ -2253,6 +2253,8 @@ void main() {
style: Typography(platform: TargetPlatform.android).black.subhead,
cursorColor: Colors.blue,
backgroundCursorColor: Colors.grey,
minLines: 10,
maxLines: 20,
),
const SizedBox(height: 100.0),
],
Expand All @@ -2272,18 +2274,22 @@ void main() {
}),
);

log.clear();

// Move to the next editable text.
await tester.showKeyboard(find.byKey(ValueKey<String>(controller2.text)));
final MethodCall methodCall2 = log.firstWhere((MethodCall m) => m.method == 'TextInput.setEditableSizeAndTransform');
expect(
methodCall2,
isMethodCall('TextInput.setEditableSizeAndTransform', arguments: <String, dynamic>{
'width': 800,
'height': 14,
'transform': Matrix4.identity().storage.toList(),
'height': 140.0,
'transform': <double>[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 214.0, 0.0, 1.0],
}),
);

log.clear();

// Move back to the first editable text.
await tester.showKeyboard(find.byKey(ValueKey<String>(controller1.text)));
final MethodCall methodCall3 = log.firstWhere((MethodCall m) => m.method == 'TextInput.setEditableSizeAndTransform');
Expand Down

0 comments on commit ae529d8

Please sign in to comment.