7 #import <OCMock/OCMock.h>
11 #import "flutter/shell/platform/darwin/ios/flutter_task_queue_dispatch.h"
12 #import "flutter/testing/testing.h"
13 #include "gtest/gtest.h"
26 EXPECT_NE(relay, nil);
27 EXPECT_EQ(messenger, relay.
parent);
30 - (void)testPassesCallOn {
34 char messageData[] = {
'a',
'a',
'r',
'o',
'n'};
35 NSData* message = [NSData dataWithBytes:messageData length:sizeof(messageData)];
36 NSString* channel =
@"foobar";
38 OCMVerify([messenger sendOnChannel:channel message:message binaryReply:nil]);
41 - (void)testDoesntPassCallOn {
45 char messageData[] = {
'a',
'a',
'r',
'o',
'n'};
46 NSData* message = [NSData dataWithBytes:messageData length:sizeof(messageData)];
47 NSString* channel =
@"foobar";
52 - (void)testSetMessageHandlerWithTaskQueue {
56 NSString* channel =
@"foobar";
57 NSObject<FlutterTaskQueue>* taskQueue = OCMProtocolMock(
@protocol(FlutterTaskQueueDispatch));
61 OCMVerify([messenger setMessageHandlerOnChannel:channel
62 binaryMessageHandler:handler
63 taskQueue:taskQueue]);
66 - (void)testMakeBackgroundTaskQueue {
71 OCMVerify([messenger makeBackgroundTaskQueue]);