@@ -114,21 +114,25 @@ TEST(FlPlatformPluginTest, ExitApplication) {
114114 EXPECT_NE (plugin, nullptr );
115115 g_autoptr (FlJsonMethodCodec) codec = fl_json_method_codec_new ();
116116
117- g_autoptr (FlValue) requestArgs = fl_value_new_map ();
118- fl_value_set_string_take (requestArgs, " type" ,
119- fl_value_new_string (" cancelable" ));
117+ ON_CALL (messenger, fl_binary_messenger_send_response (
118+ ::testing::Eq<FlBinaryMessenger*>(messenger),
119+ ::testing::_, ::testing::_, ::testing::_))
120+ .WillByDefault (testing::Return (TRUE ));
120121
121122 // Indicate that the binding is initialized.
123+ g_autoptr (GError) error = nullptr ;
122124 g_autoptr (GBytes) init_message = fl_method_codec_encode_method_call (
123- FL_METHOD_CODEC (codec), " System.initializationComplete" , nullptr ,
124- nullptr );
125+ FL_METHOD_CODEC (codec), " System.initializationComplete" , nullptr , &error);
125126 messenger.ReceiveMessage (" flutter/platform" , init_message);
126127
128+ g_autoptr (FlValue) request_args = fl_value_new_map ();
129+ fl_value_set_string_take (request_args, " type" ,
130+ fl_value_new_string (" cancelable" ));
127131 EXPECT_CALL (messenger,
128132 fl_binary_messenger_send_on_channel (
129133 ::testing::Eq<FlBinaryMessenger*>(messenger),
130134 ::testing::StrEq (" flutter/platform" ),
131- MethodCall(" System.requestAppExit" , FlValueEq(requestArgs )),
135+ MethodCall(" System.requestAppExit" , FlValueEq(request_args )),
132136 ::testing::_, ::testing::_, ::testing::_));
133137
134138 g_autoptr (FlValue) args = fl_value_new_map ();
0 commit comments