@@ -4623,6 +4623,9 @@ TEST_F(ShellTest, RuntimeStageBackendDefaultsToSkSLWithoutImpeller) {
46234623 DestroyShell (std::move (shell), task_runners);
46244624}
46254625
4626+ // TODO(dnfield): Enable GL and Vulkan after
4627+ // https://github.com/flutter/flutter/issues/140419
4628+ #if SHELL_ENABLE_METAL
46264629TEST_F (ShellTest, RuntimeStageBackendWithImpeller) {
46274630 ASSERT_FALSE (DartVMRef::IsInstanceRunning ());
46284631 Settings settings = CreateSettingsForFixture ();
@@ -4640,36 +4643,30 @@ TEST_F(ShellTest, RuntimeStageBackendWithImpeller) {
46404643
46414644 fml::AutoResetWaitableEvent latch;
46424645
4643- std::optional< impeller::Context::BackendType> impeller_backend;
4646+ impeller::Context::BackendType impeller_backend;
46444647 fml::TaskRunner::RunNowOrPostTask (
46454648 shell->GetTaskRunners ().GetPlatformTaskRunner (),
46464649 [platform_view = shell->GetPlatformView (), &latch, &impeller_backend]() {
46474650 auto impeller_context = platform_view->GetImpellerContext ();
4648- // TODO(dnfield): Enable GL and Vulkan after
4649- // https://github.com/flutter/flutter/issues/140419
4650- #if SHELL_ENABLE_METAL
46514651 EXPECT_TRUE (impeller_context);
46524652 impeller_backend = impeller_context->GetBackendType ();
4653- #endif
46544653 latch.Signal ();
46554654 });
46564655 latch.Wait ();
46574656
46584657 AddNativeCallback (
46594658 " NotifyNative" , CREATE_NATIVE_ENTRY ([&](auto args) {
46604659 auto backend = UIDartState::Current ()->GetRuntimeStageBackend ();
4661- if (impeller_backend.has_value ()) {
4662- switch (impeller_backend.value ()) {
4663- case impeller::Context::BackendType::kMetal :
4664- EXPECT_EQ (backend, impeller::RuntimeStageBackend::kMetal );
4665- break ;
4666- case impeller::Context::BackendType::kOpenGLES :
4667- EXPECT_EQ (backend, impeller::RuntimeStageBackend::kOpenGLES );
4668- break ;
4669- case impeller::Context::BackendType::kVulkan :
4670- EXPECT_EQ (backend, impeller::RuntimeStageBackend::kVulkan );
4671- break ;
4672- }
4660+ switch (impeller_backend) {
4661+ case impeller::Context::BackendType::kMetal :
4662+ EXPECT_EQ (backend, impeller::RuntimeStageBackend::kMetal );
4663+ break ;
4664+ case impeller::Context::BackendType::kOpenGLES :
4665+ EXPECT_EQ (backend, impeller::RuntimeStageBackend::kOpenGLES );
4666+ break ;
4667+ case impeller::Context::BackendType::kVulkan :
4668+ EXPECT_EQ (backend, impeller::RuntimeStageBackend::kVulkan );
4669+ break ;
46734670 }
46744671 latch.Signal ();
46754672 }));
@@ -4682,6 +4679,7 @@ TEST_F(ShellTest, RuntimeStageBackendWithImpeller) {
46824679
46834680 DestroyShell (std::move (shell), task_runners);
46844681}
4682+ #endif // SHELL_ENABLE_METAL
46854683
46864684} // namespace testing
46874685} // namespace flutter
0 commit comments