Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bac6c19

Browse files
authored
[Impeller] Run simulator tests with Impeller enabled. (#56740)
The Info.plist override was missed earlier. The main changes to the tests are due to the UI thread merge with the platform thread. The amendment to the "spawn" API are due to the fact that the assertions checked for the presence of GrDirectContext which will never exist with Impeller. Unblocks #56706
1 parent 6f941c9 commit bac6c19

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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];

shell/platform/darwin/ios/ios_context.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
}
5757

5858
IOSRenderingBackend IOSContext::GetBackend() const {
59+
// Overridden by Impeller subclasses.
5960
return IOSRenderingBackend::kSkia;
6061
}
6162

testing/ios/IosUnitTests/App/Info.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
</dict>
4747
<key>FLTLeakDartVM</key>
4848
<false/>
49-
<key>FLTEnableImpeller</key>
50-
<false/>
5149
<key>FLTTraceSystrace</key>
5250
<false/>
5351
<key>FLTEnableDartProfiling</key>

0 commit comments

Comments
 (0)