Flutter Engine
The Flutter Engine
Instance Methods | List of all members
FlutterBinaryMessengerRelayTest Class Reference
Inheritance diagram for FlutterBinaryMessengerRelayTest:

Instance Methods

(void) - testCreate [implementation]
 
(void) - testPassesCallOn [implementation]
 
(void) - testDoesntPassCallOn [implementation]
 
(void) - testSetMessageHandlerWithTaskQueue [implementation]
 
(void) - testMakeBackgroundTaskQueue [implementation]
 

Detailed Description

Definition at line 17 of file FlutterBinaryMessengerRelayTest.mm.

Method Documentation

◆ testCreate

- (void) testCreate
implementation

Definition at line 100 of file FlutterBinaryMessengerRelayTest.mm.

22 {
23 id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
25 [[FlutterBinaryMessengerRelay alloc] initWithParent:messenger];
26 EXPECT_NE(relay, nil);
27 EXPECT_EQ(messenger, relay.parent);
28}
NSObject< FlutterBinaryMessenger > * parent

◆ testDoesntPassCallOn

- (void) testDoesntPassCallOn
implementation

Definition at line 100 of file FlutterBinaryMessengerRelayTest.mm.

41 {
42 id messenger = OCMStrictProtocolMock(@protocol(FlutterBinaryMessenger));
44 [[FlutterBinaryMessengerRelay alloc] initWithParent:messenger];
45 char messageData[] = {'a', 'a', 'r', 'o', 'n'};
46 NSData* message = [NSData dataWithBytes:messageData length:sizeof(messageData)];
47 NSString* channel = @"foobar";
48 relay.parent = nil;
49 [relay sendOnChannel:channel message:message binaryReply:nil];
50}
void sendOnChannel:message:binaryReply:(NSString *channel, [message] NSData *message, [binaryReply] FlutterBinaryReply callback)
Win32Message message

◆ testMakeBackgroundTaskQueue

- (void) testMakeBackgroundTaskQueue
implementation

Definition at line 100 of file FlutterBinaryMessengerRelayTest.mm.

66 {
67 id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
69 [[FlutterBinaryMessengerRelay alloc] initWithParent:messenger];
71 OCMVerify([messenger makeBackgroundTaskQueue]);
72}
NSObject< FlutterTaskQueue > * makeBackgroundTaskQueue()
TODO(gaaclarke): Remove optional when macos supports Background Platform Channels.

◆ testPassesCallOn

- (void) testPassesCallOn
implementation

Definition at line 100 of file FlutterBinaryMessengerRelayTest.mm.

30 {
31 id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
33 [[FlutterBinaryMessengerRelay alloc] initWithParent:messenger];
34 char messageData[] = {'a', 'a', 'r', 'o', 'n'};
35 NSData* message = [NSData dataWithBytes:messageData length:sizeof(messageData)];
36 NSString* channel = @"foobar";
37 [relay sendOnChannel:channel message:message binaryReply:nil];
38 OCMVerify([messenger sendOnChannel:channel message:message binaryReply:nil]);
39}

◆ testSetMessageHandlerWithTaskQueue

- (void) testSetMessageHandlerWithTaskQueue
implementation

Definition at line 100 of file FlutterBinaryMessengerRelayTest.mm.

52 {
53 id messenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger));
55 [[FlutterBinaryMessengerRelay alloc] initWithParent:messenger];
56 NSString* channel = @"foobar";
57 NSObject<FlutterTaskQueue>* taskQueue = OCMProtocolMock(@protocol(FlutterTaskQueueDispatch));
58 FlutterBinaryMessageHandler handler = ^(NSData* _Nullable, FlutterBinaryReply _Nonnull) {
59 };
60 [relay setMessageHandlerOnChannel:channel binaryMessageHandler:handler taskQueue:taskQueue];
61 OCMVerify([messenger setMessageHandlerOnChannel:channel
62 binaryMessageHandler:handler
63 taskQueue:taskQueue]);
64}
NS_ASSUME_NONNULL_BEGIN typedef void(^ FlutterBinaryReply)(NSData *_Nullable reply)
void(^ FlutterBinaryMessageHandler)(NSData *_Nullable message, FlutterBinaryReply reply)
FlutterBinaryMessengerConnection setMessageHandlerOnChannel:binaryMessageHandler:taskQueue:(NSString *channel, [binaryMessageHandler] FlutterBinaryMessageHandler handler, [taskQueue] NSObject< FlutterTaskQueue > *taskQueue)

The documentation for this class was generated from the following file: