251 {
252 self = [super init];
253 if (self == nil) {
254 return nil;
255 }
256
257 _nextResponder = OCMClassMock([NSResponder class]);
258 [self respondChannelCallsWith:FALSE];
259 [self respondEmbedderCallsWith:FALSE];
260 [self respondTextInputWith:FALSE];
261
263
264 _messengerMock = OCMStrictProtocolMock(
@protocol(FlutterBinaryMessenger));
267 binaryReply:[OCMArg
any]])
268 .andCall(
self, @selector(handleChannelMessage:
message:binaryReply:));
269 OCMStub([
_messengerMock setMessageHandlerOnChannel:
@"flutter/keyboard"
270 binaryMessageHandler:[OCMArg
any]])
271 .andCall(
self, @selector(setKeyboardChannelHandler:handler:));
273 .andCall(
self, @selector(handleKeyboardChannelMessage:
message:));
274 id viewDelegateMock = OCMStrictProtocolMock(@protocol(FlutterKeyboardViewDelegate));
275 OCMStub([viewDelegateMock
nextResponder]).andReturn(_nextResponder);
276 OCMStub([viewDelegateMock onTextInputKeyEvent:[OCMArg
any]])
277 .andCall(
self, @selector(handleTextInputKeyEvent:));
278 OCMStub([viewDelegateMock getBinaryMessenger]).andReturn(
_messengerMock);
279 OCMStub([viewDelegateMock sendKeyEvent:*(const
FlutterKeyEvent*)[OCMArg anyPointer]
281 userData:nil])
282 .ignoringNonObjectArgs()
283 .andCall(
self, @selector(handleEmbedderEvent:
callback:userData:));
284 OCMStub([viewDelegateMock subscribeToKeyboardLayoutChange:[OCMArg
any]])
285 .andCall(
self, @selector(onSetKeyboardLayoutNotifier:));
286 OCMStub([viewDelegateMock lookUpLayoutForKeyCode:0 shift:
false])
287 .ignoringNonObjectArgs()
288 .andCall(
self, @selector(lookUpLayoutForKeyCode:shift:));
289
291 return self;
292}
NSResponder * nextResponder
const MockLayoutData * _currentLayout
NSObject< FlutterBinaryMessenger > * _messengerMock
SIT bool any(const Vec< 1, T > &x)