@@ -114,21 +114,25 @@ TEST(FlPlatformPluginTest, ExitApplication) {
114
114
EXPECT_NE (plugin, nullptr );
115
115
g_autoptr (FlJsonMethodCodec) codec = fl_json_method_codec_new ();
116
116
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 ));
120
121
121
122
// Indicate that the binding is initialized.
123
+ g_autoptr (GError) error = nullptr ;
122
124
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);
125
126
messenger.ReceiveMessage (" flutter/platform" , init_message);
126
127
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" ));
127
131
EXPECT_CALL (messenger,
128
132
fl_binary_messenger_send_on_channel (
129
133
::testing::Eq<FlBinaryMessenger*>(messenger),
130
134
::testing::StrEq (" flutter/platform" ),
131
- MethodCall(" System.requestAppExit" , FlValueEq(requestArgs )),
135
+ MethodCall(" System.requestAppExit" , FlValueEq(request_args )),
132
136
::testing::_, ::testing::_, ::testing::_));
133
137
134
138
g_autoptr (FlValue) args = fl_value_new_map ();
0 commit comments