diff --git a/shell/platform/darwin/common/framework/Source/FlutterChannelsTest.m b/shell/platform/darwin/common/framework/Source/FlutterChannelsTest.m index 52e52de3dc298..1bd2e7e2b7ac9 100644 --- a/shell/platform/darwin/common/framework/Source/FlutterChannelsTest.m +++ b/shell/platform/darwin/common/framework/Source/FlutterChannelsTest.m @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// These tests are flaky on arm64. -// TODO(dnfield): reenable after fixing https://github.com/flutter/flutter/issues/126013 -#if !defined(__aarch64__) && !defined(__arm64__) - #if !__has_feature(objc_arc) #error ARC must be enabled! #endif @@ -15,6 +11,9 @@ #import #import +@protocol FlutterTaskQueue +@end + @interface MockBinaryMessenger : NSObject @property(nonatomic, copy) NSString* channel; @property(nonatomic, strong) NSData* message; @@ -218,7 +217,7 @@ - (void)testBasicMessageChannelTaskQueue { FlutterBinaryMessengerConnection connection = 123; id binaryMessenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger)); id codec = OCMProtocolMock(@protocol(FlutterMethodCodec)); - id taskQueue = OCMClassMock([NSObject class]); + id taskQueue = OCMProtocolMock(@protocol(FlutterTaskQueue)); FlutterBasicMessageChannel* channel = [[FlutterBasicMessageChannel alloc] initWithName:channelName binaryMessenger:binaryMessenger @@ -246,7 +245,7 @@ - (void)testBasicMessageChannelInvokeHandlerAfterChannelReleased { FlutterBinaryMessengerConnection connection = 123; id binaryMessenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger)); id codec = OCMProtocolMock(@protocol(FlutterMessageCodec)); - id taskQueue = OCMClassMock([NSObject class]); + id taskQueue = OCMProtocolMock(@protocol(FlutterTaskQueue)); FlutterBasicMessageChannel* channel = [[FlutterBasicMessageChannel alloc] initWithName:channelName binaryMessenger:binaryMessenger @@ -283,7 +282,7 @@ - (void)testMethodChannelInvokeHandlerAfterChannelReleased { @autoreleasepool { id binaryMessenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger)); id codec = OCMProtocolMock(@protocol(FlutterMethodCodec)); - id taskQueue = OCMClassMock([NSObject class]); + id taskQueue = OCMProtocolMock(@protocol(FlutterTaskQueue)); FlutterMethodChannel* channel = [[FlutterMethodChannel alloc] initWithName:channelName binaryMessenger:binaryMessenger codec:codec @@ -315,7 +314,7 @@ - (void)testMethodChannelTaskQueue { FlutterBinaryMessengerConnection connection = 123; id binaryMessenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger)); id codec = OCMProtocolMock(@protocol(FlutterMethodCodec)); - id taskQueue = OCMClassMock([NSObject class]); + id taskQueue = OCMProtocolMock(@protocol(FlutterTaskQueue)); FlutterMethodChannel* channel = [[FlutterMethodChannel alloc] initWithName:channelName binaryMessenger:binaryMessenger codec:codec @@ -340,7 +339,7 @@ - (void)testEventChannelTaskQueue { FlutterBinaryMessengerConnection connection = 123; id binaryMessenger = OCMProtocolMock(@protocol(FlutterBinaryMessenger)); id codec = OCMProtocolMock(@protocol(FlutterMethodCodec)); - id taskQueue = OCMClassMock([NSObject class]); + id taskQueue = OCMProtocolMock(@protocol(FlutterTaskQueue)); id handler = OCMProtocolMock(@protocol(FlutterStreamHandler)); FlutterEventChannel* channel = [[FlutterEventChannel alloc] initWithName:channelName binaryMessenger:binaryMessenger @@ -360,5 +359,3 @@ - (void)testEventChannelTaskQueue { } @end - -#endif // !defined(__arch64__) && !defined(__arm64__)