From ae529d8be0e7eb36128ea59682cf065e1246a86b Mon Sep 17 00:00:00 2001 From: Nurhan Turgut <50856934+nturgut@users.noreply.github.com> Date: Wed, 25 Sep 2019 13:14:59 -0700 Subject: [PATCH] Fixing the editable_text unit tests by clearing the log. Add a modification for also testing cached size. (#41300) --- packages/flutter/test/widgets/editable_text_test.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 63260ecda7..cd49780350 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -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), ], @@ -2272,6 +2274,8 @@ void main() { }), ); + log.clear(); + // Move to the next editable text. await tester.showKeyboard(find.byKey(ValueKey(controller2.text))); final MethodCall methodCall2 = log.firstWhere((MethodCall m) => m.method == 'TextInput.setEditableSizeAndTransform'); @@ -2279,11 +2283,13 @@ void main() { methodCall2, isMethodCall('TextInput.setEditableSizeAndTransform', arguments: { 'width': 800, - 'height': 14, - 'transform': Matrix4.identity().storage.toList(), + 'height': 140.0, + 'transform': [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(controller1.text))); final MethodCall methodCall3 = log.firstWhere((MethodCall m) => m.method == 'TextInput.setEditableSizeAndTransform');