5#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.h"
7#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"
8#import "flutter/shell/platform/darwin/macos/framework/Source/TestFlutterPlatformView.h"
10#include "flutter/testing/testing.h"
22 @"viewType" :
@"FlutterPlatformViewMock"
25 __block
bool errored =
false;
32 [platformViewController handleMethodCall:methodCall
result:
result];
44 [platformViewController registerViewFactory:factory withId:
@"MockPlatformView"];
46 NSDictionary* creationArgs = @{
47 @"album" :
@"スコットとリバース",
48 @"releaseYear" : @2013,
49 @"artists" : @[
@"Scott Murphy",
@"Rivers Cuomo" ],
50 @"playlist" : @[
@"おかしいやつ",
@"ほどけていたんだ" ],
52 NSObject<FlutterMessageCodec>* codec = [factory createArgsCodec];
60 @"viewType" :
@"MockPlatformView",
61 @"params" : creationArgsData,
64 __block
bool success =
false;
71 [platformViewController handleMethodCall:methodCall
result:
result];
77 ASSERT_TRUE(view != nil);
78 ASSERT_TRUE(view.
args != nil);
81 NSString* album = [view.
args objectForKey:
@"album"];
85 NSNumber* releaseYear = [view.
args objectForKey:
@"releaseYear"];
86 EXPECT_EQ(releaseYear.intValue, 2013);
89 NSArray* artists = [view.
args objectForKey:
@"artists"];
90 ASSERT_TRUE(artists != nil);
91 ASSERT_EQ(artists.count, 2ul);
92 EXPECT_TRUE([artists[0] isEqualToString:
@"Scott Murphy"]);
93 EXPECT_TRUE([artists[1] isEqualToString:
@"Rivers Cuomo"]);
95 NSArray* playlist = [view.
args objectForKey:
@"playlist"];
96 ASSERT_EQ(playlist.count, 2ul);
97 EXPECT_TRUE([playlist[0] isEqualToString:
@"おかしいやつ"]);
98 EXPECT_TRUE([playlist[1] isEqualToString:
@"ほどけていたんだ"]);
107 [platformViewController registerViewFactory:factory withId:
@"MockPlatformView"];
113 @"viewType" :
@"MockPlatformView"
116 __block
bool created =
false;
124 [platformViewController handleMethodCall:methodCallOnCreate
result:resultOnCreate];
128 arguments:[NSNumber numberWithLongLong:2]];
130 __block
bool disposed =
false;
138 [platformViewController handleMethodCall:methodCallOnDispose
result:resultOnDispose];
150 arguments:[NSNumber numberWithLongLong:20]];
152 __block
bool errored =
false;
159 [platformViewController handleMethodCall:methodCall
result:
result];
168 withId:
@"MockPlatformView"];
171 const NSNumber* viewId = [NSNumber numberWithLongLong:2];
173 methodCallWithMethodName:
@"create"
174 arguments:@{
@"id" : viewId,
@"viewType" :
@"MockPlatformView"}];
175 __block
bool created =
false;
182 [platformViewController handleMethodCall:methodCallOnCreate
result:resultOnCreate];
186 [
FlutterMethodCall methodCallWithMethodName:
@"acceptGesture" arguments:@{
@"id" : viewId}];
187 __block
bool acceptGestureCalled =
false;
191 acceptGestureCalled =
true;
194 [platformViewController handleMethodCall:methodCallAcceptGesture
result:resultAcceptGesture];
204 withId:
@"MockPlatformView"];
211 __block
bool errored =
false;
217 [platformViewController handleMethodCall:methodCallAcceptGesture
result:
result];
226 withId:
@"MockPlatformView"];
229 const NSNumber* viewId = [NSNumber numberWithLongLong:2];
231 methodCallWithMethodName:
@"create"
232 arguments:@{
@"id" : viewId,
@"viewType" :
@"MockPlatformView"}];
233 __block
bool created =
false;
240 [platformViewController handleMethodCall:methodCallOnCreate
result:resultOnCreate];
244 [
FlutterMethodCall methodCallWithMethodName:
@"rejectGesture" arguments:@{
@"id" : viewId}];
245 __block
bool rejectGestureCalled =
false;
249 rejectGestureCalled =
true;
252 [platformViewController handleMethodCall:methodCallRejectGesture
result:resultRejectGesture];
262 withId:
@"MockPlatformView"];
269 __block
bool errored =
false;
275 [platformViewController handleMethodCall:methodCallRejectGesture
result:
result];
void(^ FlutterResult)(id _Nullable result)
static void encode(uint8_t output[16], const uint32_t input[4])
TEST(DisplayListComplexity, EmptyDisplayList)
#define EXPECT_TRUE(handle)