@@ -270,12 +270,13 @@ - (void)testSetHandlerAfterRun {
270270 fml::AutoResetWaitableEvent latch;
271271 [engine run ];
272272 flutter::Shell& shell = engine.shell ;
273- engine.shell .GetTaskRunners ().GetUITaskRunner ()->PostTask ([&latch, &shell] {
274- flutter::Engine::Delegate& delegate = shell;
275- auto message = std::make_unique<flutter::PlatformMessage>(" foo" , nullptr );
276- delegate.OnEngineHandlePlatformMessage (std::move (message));
277- latch.Signal ();
278- });
273+ fml::TaskRunner::RunNowOrPostTask (
274+ engine.shell .GetTaskRunners ().GetUITaskRunner (), [&latch, &shell] {
275+ flutter::Engine::Delegate& delegate = shell;
276+ auto message = std::make_unique<flutter::PlatformMessage>(" foo" , nullptr );
277+ delegate.OnEngineHandlePlatformMessage (std::move (message));
278+ latch.Signal ();
279+ });
279280 latch.Wait ();
280281 [registrar.messenger setMessageHandlerOnChannel: @" foo"
281282 binaryMessageHandler: ^(NSData * message, FlutterBinaryReply reply) {
@@ -287,14 +288,11 @@ - (void)testSetHandlerAfterRun {
287288
288289- (void )testThreadPrioritySetCorrectly {
289290 XCTestExpectation* prioritiesSet = [self expectationWithDescription: @" prioritiesSet" ];
290- prioritiesSet.expectedFulfillmentCount = 3 ;
291+ prioritiesSet.expectedFulfillmentCount = 2 ;
291292
292293 IMP mockSetThreadPriority =
293294 imp_implementationWithBlock (^(NSThread * thread, double threadPriority) {
294- if ([thread.name hasSuffix: @" .ui" ]) {
295- XCTAssertEqual (threadPriority, 1.0 );
296- [prioritiesSet fulfill ];
297- } else if ([thread.name hasSuffix: @" .raster" ]) {
295+ if ([thread.name hasSuffix: @" .raster" ]) {
298296 XCTAssertEqual (threadPriority, 1.0 );
299297 [prioritiesSet fulfill ];
300298 } else if ([thread.name hasSuffix: @" .io" ]) {
@@ -429,10 +427,6 @@ - (void)testSpawnsShareGpuContext {
429427 std::shared_ptr<flutter::IOSContext> engine_context = [engine iosPlatformView ]->GetIosContext ();
430428 std::shared_ptr<flutter::IOSContext> spawn_context = [spawn iosPlatformView ]->GetIosContext ();
431429 XCTAssertEqual (engine_context, spawn_context);
432- // If this assert fails it means we may be using the software. For software rendering, this is
433- // expected to be nullptr.
434- XCTAssertTrue (engine_context->GetMainContext () != nullptr );
435- XCTAssertEqual (engine_context->GetMainContext (), spawn_context->GetMainContext ());
436430}
437431
438432- (void )testEnableSemanticsWhenFlutterViewAccessibilityDidCall {
@@ -445,7 +439,6 @@ - (void)testEnableSemanticsWhenFlutterViewAccessibilityDidCall {
445439- (void )testCanMergePlatformAndUIThread {
446440#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
447441 auto settings = FLTDefaultSettingsForBundle ();
448- settings.enable_impeller = true ;
449442 FlutterDartProject* project = [[FlutterDartProject alloc ] initWithSettings: settings];
450443 FlutterEngine* engine = [[FlutterEngine alloc ] initWithName: @" foobar" project: project];
451444 [engine run ];
@@ -458,7 +451,6 @@ - (void)testCanMergePlatformAndUIThread {
458451- (void )testCanUnMergePlatformAndUIThread {
459452#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
460453 auto settings = FLTDefaultSettingsForBundle ();
461- settings.enable_impeller = true ;
462454 settings.merged_platform_ui_thread = false ;
463455 FlutterDartProject* project = [[FlutterDartProject alloc ] initWithSettings: settings];
464456 FlutterEngine* engine = [[FlutterEngine alloc ] initWithName: @" foobar" project: project];
0 commit comments