Fix a typo so that the secure input view is properly initialized (flutter/engine#17816)
This commit is contained in:
@@ -819,7 +819,7 @@ static NSString* uniqueIdFromDictionary(NSDictionary* dictionary) {
|
||||
if (self) {
|
||||
_nonAutofillInputView = [[FlutterTextInputView alloc] init];
|
||||
_nonAutofillInputView.secureTextEntry = NO;
|
||||
_nonAutofillInputView = [[FlutterTextInputView alloc] init];
|
||||
_nonAutofillSecureInputView = [[FlutterTextInputView alloc] init];
|
||||
_nonAutofillSecureInputView.secureTextEntry = YES;
|
||||
_inputViews = [[NSMutableArray alloc] init];
|
||||
|
||||
|
||||
@@ -14,7 +14,43 @@ FLUTTER_ASSERT_ARC
|
||||
@end
|
||||
|
||||
@implementation FlutterTextInputPluginTest
|
||||
- (void)testSecureInput {
|
||||
// Setup test.
|
||||
id engine = OCMClassMock([FlutterEngine class]);
|
||||
FlutterTextInputPlugin* textInputPlugin = [[FlutterTextInputPlugin alloc] init];
|
||||
textInputPlugin.textInputDelegate = engine;
|
||||
|
||||
NSDictionary* config = @{
|
||||
@"inputType" : @{@"name" : @"TextInuptType.text"},
|
||||
@"keyboardAppearance" : @"Brightness.light",
|
||||
@"obscureText" : @YES,
|
||||
@"inputAction" : @"TextInputAction.unspecified",
|
||||
@"smartDashesType" : @"0",
|
||||
@"smartQuotesType" : @"0",
|
||||
@"autocorrect" : @YES
|
||||
};
|
||||
|
||||
FlutterMethodCall* setClientCall =
|
||||
[FlutterMethodCall methodCallWithMethodName:@"TextInput.setClient"
|
||||
arguments:@[ @123, config ]];
|
||||
|
||||
[textInputPlugin handleMethodCall:setClientCall
|
||||
result:^(id _Nullable result){
|
||||
}];
|
||||
|
||||
// Find all input views in the input hider view.
|
||||
NSArray<FlutterTextInputView*>* inputFields =
|
||||
[[[textInputPlugin textInputView] superview] subviews];
|
||||
|
||||
// Find the inactive autofillable input field.
|
||||
FlutterTextInputView* inputView = inputFields[0];
|
||||
|
||||
// Verify secureTextEntry is set to the correct value.
|
||||
XCTAssertTrue(inputView.secureTextEntry);
|
||||
|
||||
// Clean up mocks
|
||||
[engine stopMocking];
|
||||
}
|
||||
- (void)testAutofillInputViews {
|
||||
// Setup test.
|
||||
id engine = OCMClassMock([FlutterEngine class]);
|
||||
|
||||
Reference in New Issue
Block a user