|
2 | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | 3 | // found in the LICENSE file. |
4 | 4 |
|
| 5 | +#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterBinaryMessengerRelay.h" |
| 6 | +#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine_Test.h" |
5 | 7 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" |
6 | 8 |
|
7 | 9 | #import <OCMock/OCMock.h> |
@@ -308,7 +310,7 @@ - (void)testAutocorrectionPromptRectAppears { |
308 | 310 | withClient:0]); |
309 | 311 | } |
310 | 312 |
|
311 | | -- (void)testIngoresSelectionChangeIfSelectionIsDisabled { |
| 313 | +- (void)testIgnoresSelectionChangeIfSelectionIsDisabled { |
312 | 314 | FlutterTextInputView* inputView = [[FlutterTextInputView alloc] initWithOwner:textInputPlugin]; |
313 | 315 | __block int updateCount = 0; |
314 | 316 | OCMStub([engine flutterTextInputView:inputView updateEditingClient:0 withState:[OCMArg isNotNil]]) |
@@ -678,6 +680,27 @@ - (void)testUpdateSecureTextEntry { |
678 | 680 | XCTAssertFalse(inputView.isSecureTextEntry); |
679 | 681 | } |
680 | 682 |
|
| 683 | +- (void)testInputActionContinueAction { |
| 684 | + id mockBinaryMessenger = OCMClassMock([FlutterBinaryMessengerRelay class]); |
| 685 | + FlutterEngine* testEngine = [[FlutterEngine alloc] init]; |
| 686 | + [testEngine setBinaryMessenger:mockBinaryMessenger]; |
| 687 | + [testEngine runWithEntrypoint:FlutterDefaultDartEntrypoint initialRoute:@"test"]; |
| 688 | + |
| 689 | + FlutterTextInputPlugin* inputPlugin = |
| 690 | + [[FlutterTextInputPlugin alloc] initWithDelegate:(id<FlutterTextInputDelegate>)testEngine]; |
| 691 | + FlutterTextInputView* inputView = [[FlutterTextInputView alloc] initWithOwner:inputPlugin]; |
| 692 | + |
| 693 | + [testEngine flutterTextInputView:inputView |
| 694 | + performAction:FlutterTextInputActionContinue |
| 695 | + withClient:123]; |
| 696 | + |
| 697 | + FlutterMethodCall* methodCall = |
| 698 | + [FlutterMethodCall methodCallWithMethodName:@"TextInputClient.performAction" |
| 699 | + arguments:@[ @(123), @"TextInputAction.continueAction" ]]; |
| 700 | + NSData* encodedMethodCall = [[FlutterJSONMethodCodec sharedInstance] encodeMethodCall:methodCall]; |
| 701 | + OCMVerify([mockBinaryMessenger sendOnChannel:@"flutter/textinput" message:encodedMethodCall]); |
| 702 | +} |
| 703 | + |
681 | 704 | #pragma mark - TextEditingDelta tests |
682 | 705 | - (void)testTextEditingDeltasAreGeneratedOnTextInput { |
683 | 706 | FlutterTextInputView* inputView = [[FlutterTextInputView alloc] initWithOwner:textInputPlugin]; |
|
0 commit comments