2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
- // These tests are flaky on arm64.
6
- // TODO(dnfield): reenable after fixing https://github.com/flutter/flutter/issues/126013
7
- #if !defined(__aarch64__) && !defined(__arm64__)
8
-
9
5
#if !__has_feature(objc_arc)
10
6
#error ARC must be enabled!
11
7
#endif
15
11
#import < OCMock/OCMock.h>
16
12
#import < XCTest/XCTest.h>
17
13
14
+ @protocol FlutterTaskQueue <NSObject >
15
+ @end
16
+
18
17
@interface MockBinaryMessenger : NSObject <FlutterBinaryMessenger>
19
18
@property (nonatomic , copy ) NSString * channel;
20
19
@property (nonatomic , strong ) NSData * message;
@@ -218,7 +217,7 @@ - (void)testBasicMessageChannelTaskQueue {
218
217
FlutterBinaryMessengerConnection connection = 123 ;
219
218
id binaryMessenger = OCMProtocolMock (@protocol (FlutterBinaryMessenger));
220
219
id codec = OCMProtocolMock (@protocol (FlutterMethodCodec));
221
- id taskQueue = OCMClassMock ([ NSObject class ] );
220
+ id taskQueue = OCMProtocolMock ( @protocol (FlutterTaskQueue) );
222
221
FlutterBasicMessageChannel* channel =
223
222
[[FlutterBasicMessageChannel alloc ] initWithName: channelName
224
223
binaryMessenger: binaryMessenger
@@ -246,7 +245,7 @@ - (void)testBasicMessageChannelInvokeHandlerAfterChannelReleased {
246
245
FlutterBinaryMessengerConnection connection = 123 ;
247
246
id binaryMessenger = OCMProtocolMock (@protocol (FlutterBinaryMessenger));
248
247
id codec = OCMProtocolMock (@protocol (FlutterMessageCodec));
249
- id taskQueue = OCMClassMock ([ NSObject class ] );
248
+ id taskQueue = OCMProtocolMock ( @protocol (FlutterTaskQueue) );
250
249
FlutterBasicMessageChannel* channel =
251
250
[[FlutterBasicMessageChannel alloc ] initWithName: channelName
252
251
binaryMessenger: binaryMessenger
@@ -283,7 +282,7 @@ - (void)testMethodChannelInvokeHandlerAfterChannelReleased {
283
282
@autoreleasepool {
284
283
id binaryMessenger = OCMProtocolMock (@protocol (FlutterBinaryMessenger));
285
284
id codec = OCMProtocolMock (@protocol (FlutterMethodCodec));
286
- id taskQueue = OCMClassMock ([ NSObject class ] );
285
+ id taskQueue = OCMProtocolMock ( @protocol (FlutterTaskQueue) );
287
286
FlutterMethodChannel* channel = [[FlutterMethodChannel alloc ] initWithName: channelName
288
287
binaryMessenger: binaryMessenger
289
288
codec: codec
@@ -315,7 +314,7 @@ - (void)testMethodChannelTaskQueue {
315
314
FlutterBinaryMessengerConnection connection = 123 ;
316
315
id binaryMessenger = OCMProtocolMock (@protocol (FlutterBinaryMessenger));
317
316
id codec = OCMProtocolMock (@protocol (FlutterMethodCodec));
318
- id taskQueue = OCMClassMock ([ NSObject class ] );
317
+ id taskQueue = OCMProtocolMock ( @protocol (FlutterTaskQueue) );
319
318
FlutterMethodChannel* channel = [[FlutterMethodChannel alloc ] initWithName: channelName
320
319
binaryMessenger: binaryMessenger
321
320
codec: codec
@@ -340,7 +339,7 @@ - (void)testEventChannelTaskQueue {
340
339
FlutterBinaryMessengerConnection connection = 123 ;
341
340
id binaryMessenger = OCMProtocolMock (@protocol (FlutterBinaryMessenger));
342
341
id codec = OCMProtocolMock (@protocol (FlutterMethodCodec));
343
- id taskQueue = OCMClassMock ([ NSObject class ] );
342
+ id taskQueue = OCMProtocolMock ( @protocol (FlutterTaskQueue) );
344
343
id handler = OCMProtocolMock (@protocol (FlutterStreamHandler));
345
344
FlutterEventChannel* channel = [[FlutterEventChannel alloc ] initWithName: channelName
346
345
binaryMessenger: binaryMessenger
@@ -360,5 +359,3 @@ - (void)testEventChannelTaskQueue {
360
359
}
361
360
362
361
@end
363
-
364
- #endif // !defined(__arch64__) && !defined(__arm64__)
0 commit comments