From fafbcd223b52136ebc8e02d7aa6831a5eca5b105 Mon Sep 17 00:00:00 2001 From: David Worsham Date: Tue, 11 Aug 2020 01:01:38 -0700 Subject: [PATCH] Fix broken Fuchsia test (#20397) --- shell/platform/fuchsia/flutter/platform_view.cc | 7 +++++-- shell/platform/fuchsia/flutter/platform_view_unittest.cc | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/shell/platform/fuchsia/flutter/platform_view.cc b/shell/platform/fuchsia/flutter/platform_view.cc index 85210944a72..69fd116c5a2 100644 --- a/shell/platform/fuchsia/flutter/platform_view.cc +++ b/shell/platform/fuchsia/flutter/platform_view.cc @@ -582,8 +582,11 @@ std::unique_ptr PlatformView::CreateRenderingSurface() { // This platform does not repeatly lose and gain a surface connection. So the // surface is setup once during platform view setup and returned to the // shell on the initial (and only) |NotifyCreated| call. - auto view_embedder = on_get_view_embedder_callback_(); - auto gr_context = on_get_gr_context_callback_(); + auto view_embedder = on_get_view_embedder_callback_ + ? on_get_view_embedder_callback_() + : nullptr; + auto gr_context = + on_get_gr_context_callback_ ? on_get_gr_context_callback_() : nullptr; return std::make_unique(debug_label_, view_embedder, gr_context); } diff --git a/shell/platform/fuchsia/flutter/platform_view_unittest.cc b/shell/platform/fuchsia/flutter/platform_view_unittest.cc index 38960811459..0144efd8e3c 100644 --- a/shell/platform/fuchsia/flutter/platform_view_unittest.cc +++ b/shell/platform/fuchsia/flutter/platform_view_unittest.cc @@ -555,6 +555,7 @@ TEST_F(PlatformViewTests, GetGrContextTest) { services_provider.service_directory(), // runner_services nullptr, // parent_environment_service_provider_handle nullptr, // session_listener_request + nullptr, // focuser nullptr, // on_session_listener_error_callback nullptr, // session_metrics_did_change_callback nullptr, // session_size_change_hint_callback