[Impeller] Run simulator tests with Impeller enabled. (flutter/engine#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 https://github.com/flutter/engine/pull/56706
This commit is contained in:
parent
8958ff46da
commit
daa09b9a64
@ -270,7 +270,8 @@ FLUTTER_ASSERT_ARC
|
|||||||
fml::AutoResetWaitableEvent latch;
|
fml::AutoResetWaitableEvent latch;
|
||||||
[engine run];
|
[engine run];
|
||||||
flutter::Shell& shell = engine.shell;
|
flutter::Shell& shell = engine.shell;
|
||||||
engine.shell.GetTaskRunners().GetUITaskRunner()->PostTask([&latch, &shell] {
|
fml::TaskRunner::RunNowOrPostTask(
|
||||||
|
engine.shell.GetTaskRunners().GetUITaskRunner(), [&latch, &shell] {
|
||||||
flutter::Engine::Delegate& delegate = shell;
|
flutter::Engine::Delegate& delegate = shell;
|
||||||
auto message = std::make_unique<flutter::PlatformMessage>("foo", nullptr);
|
auto message = std::make_unique<flutter::PlatformMessage>("foo", nullptr);
|
||||||
delegate.OnEngineHandlePlatformMessage(std::move(message));
|
delegate.OnEngineHandlePlatformMessage(std::move(message));
|
||||||
@ -287,14 +288,11 @@ FLUTTER_ASSERT_ARC
|
|||||||
|
|
||||||
- (void)testThreadPrioritySetCorrectly {
|
- (void)testThreadPrioritySetCorrectly {
|
||||||
XCTestExpectation* prioritiesSet = [self expectationWithDescription:@"prioritiesSet"];
|
XCTestExpectation* prioritiesSet = [self expectationWithDescription:@"prioritiesSet"];
|
||||||
prioritiesSet.expectedFulfillmentCount = 3;
|
prioritiesSet.expectedFulfillmentCount = 2;
|
||||||
|
|
||||||
IMP mockSetThreadPriority =
|
IMP mockSetThreadPriority =
|
||||||
imp_implementationWithBlock(^(NSThread* thread, double threadPriority) {
|
imp_implementationWithBlock(^(NSThread* thread, double threadPriority) {
|
||||||
if ([thread.name hasSuffix:@".ui"]) {
|
if ([thread.name hasSuffix:@".raster"]) {
|
||||||
XCTAssertEqual(threadPriority, 1.0);
|
|
||||||
[prioritiesSet fulfill];
|
|
||||||
} else if ([thread.name hasSuffix:@".raster"]) {
|
|
||||||
XCTAssertEqual(threadPriority, 1.0);
|
XCTAssertEqual(threadPriority, 1.0);
|
||||||
[prioritiesSet fulfill];
|
[prioritiesSet fulfill];
|
||||||
} else if ([thread.name hasSuffix:@".io"]) {
|
} else if ([thread.name hasSuffix:@".io"]) {
|
||||||
@ -429,10 +427,6 @@ FLUTTER_ASSERT_ARC
|
|||||||
std::shared_ptr<flutter::IOSContext> engine_context = [engine iosPlatformView]->GetIosContext();
|
std::shared_ptr<flutter::IOSContext> engine_context = [engine iosPlatformView]->GetIosContext();
|
||||||
std::shared_ptr<flutter::IOSContext> spawn_context = [spawn iosPlatformView]->GetIosContext();
|
std::shared_ptr<flutter::IOSContext> spawn_context = [spawn iosPlatformView]->GetIosContext();
|
||||||
XCTAssertEqual(engine_context, spawn_context);
|
XCTAssertEqual(engine_context, spawn_context);
|
||||||
// If this assert fails it means we may be using the software. For software rendering, this is
|
|
||||||
// expected to be nullptr.
|
|
||||||
XCTAssertTrue(engine_context->GetMainContext() != nullptr);
|
|
||||||
XCTAssertEqual(engine_context->GetMainContext(), spawn_context->GetMainContext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testEnableSemanticsWhenFlutterViewAccessibilityDidCall {
|
- (void)testEnableSemanticsWhenFlutterViewAccessibilityDidCall {
|
||||||
@ -445,7 +439,6 @@ FLUTTER_ASSERT_ARC
|
|||||||
- (void)testCanMergePlatformAndUIThread {
|
- (void)testCanMergePlatformAndUIThread {
|
||||||
#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
|
#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
|
||||||
auto settings = FLTDefaultSettingsForBundle();
|
auto settings = FLTDefaultSettingsForBundle();
|
||||||
settings.enable_impeller = true;
|
|
||||||
FlutterDartProject* project = [[FlutterDartProject alloc] initWithSettings:settings];
|
FlutterDartProject* project = [[FlutterDartProject alloc] initWithSettings:settings];
|
||||||
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project];
|
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project];
|
||||||
[engine run];
|
[engine run];
|
||||||
@ -458,7 +451,6 @@ FLUTTER_ASSERT_ARC
|
|||||||
- (void)testCanUnMergePlatformAndUIThread {
|
- (void)testCanUnMergePlatformAndUIThread {
|
||||||
#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
|
#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
|
||||||
auto settings = FLTDefaultSettingsForBundle();
|
auto settings = FLTDefaultSettingsForBundle();
|
||||||
settings.enable_impeller = true;
|
|
||||||
settings.merged_platform_ui_thread = false;
|
settings.merged_platform_ui_thread = false;
|
||||||
FlutterDartProject* project = [[FlutterDartProject alloc] initWithSettings:settings];
|
FlutterDartProject* project = [[FlutterDartProject alloc] initWithSettings:settings];
|
||||||
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project];
|
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project];
|
||||||
|
@ -56,6 +56,7 @@ std::unique_ptr<IOSContext> IOSContext::Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
IOSRenderingBackend IOSContext::GetBackend() const {
|
IOSRenderingBackend IOSContext::GetBackend() const {
|
||||||
|
// Overridden by Impeller subclasses.
|
||||||
return IOSRenderingBackend::kSkia;
|
return IOSRenderingBackend::kSkia;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,6 @@
|
|||||||
</dict>
|
</dict>
|
||||||
<key>FLTLeakDartVM</key>
|
<key>FLTLeakDartVM</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>FLTEnableImpeller</key>
|
|
||||||
<false/>
|
|
||||||
<key>FLTTraceSystrace</key>
|
<key>FLTTraceSystrace</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>FLTEnableDartProfiling</key>
|
<key>FLTEnableDartProfiling</key>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user