#include "gtest/gtest.h"
#include "flutter/shell/platform/linux/fl_binary_messenger_private.h"
#include "flutter/shell/platform/linux/fl_engine_private.h"
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_basic_message_channel.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_channel.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_method_codec.h"
#include "flutter/shell/platform/linux/testing/fl_test.h"
#include "flutter/shell/platform/linux/testing/mock_renderer.h"
Go to the source code of this file.
Classes | |
struct | UserDataReassignMethod |
Functions | |
static void | method_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
TEST (FlMethodChannelTest, InvokeMethod) | |
static void | nullptr_args_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
TEST (FlMethodChannelTest, InvokeMethodNullptrArgsMessage) | |
static void | error_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
TEST (FlMethodChannelTest, InvokeMethodError) | |
static void | not_implemented_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
TEST (FlMethodChannelTest, InvokeMethodNotImplemented) | |
static void | failure_response_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
TEST (FlMethodChannelTest, InvokeMethodFailure) | |
static void | method_call_success_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | method_call_success_response_cb (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
TEST (FlMethodChannelTest, ReceiveMethodCallRespondSuccess) | |
static void | method_call_error_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | method_call_error_response_cb (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
TEST (FlMethodChannelTest, ReceiveMethodCallRespondError) | |
static void | method_call_not_implemented_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
static void | method_call_not_implemented_response_cb (FlBinaryMessenger *messenger, const gchar *channel, GBytes *message, FlBinaryMessengerResponseHandle *response_handle, gpointer user_data) |
TEST (FlMethodChannelTest, ReceiveMethodCallRespondNotImplemented) | |
G_DECLARE_FINAL_TYPE (TestMethodCodec, test_method_codec, TEST, METHOD_CODEC, FlMethodCodec) struct _TestMethodCodec | |
static void | test_method_codec_dispose (GObject *object) |
static GBytes * | test_method_codec_encode_method_call (FlMethodCodec *codec, const gchar *name, FlValue *args, GError **error) |
static gboolean | test_method_codec_decode_method_call (FlMethodCodec *codec, GBytes *message, gchar **name, FlValue **args, GError **error) |
static GBytes * | test_method_codec_encode_success_envelope (FlMethodCodec *codec, FlValue *result, GError **error) |
static GBytes * | test_method_codec_encode_error_envelope (FlMethodCodec *codec, const gchar *code, const gchar *message, FlValue *details, GError **error) |
static FlMethodResponse * | test_method_codec_decode_response (FlMethodCodec *codec, GBytes *message, GError **error) |
static void | test_method_codec_class_init (TestMethodCodecClass *klass) |
static void | test_method_codec_init (TestMethodCodec *self) |
TestMethodCodec * | test_method_codec_new () |
static void | method_call_success_error_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
TEST (FlMethodChannelTest, ReceiveMethodCallRespondSuccessError) | |
static void | method_call_error_error_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer user_data) |
TEST (FlMethodChannelTest, ReceiveMethodCallRespondErrorError) | |
static void | reassign_method_cb (FlMethodChannel *channel, FlMethodCall *method_call, gpointer raw_user_data) |
TEST (FlMethodChannelTest, ReplaceADisposedMethodChannel) | |
TEST (FlMethodChannelTest, DisposeAReplacedMethodChannel) | |
|
static |
Definition at line 94 of file fl_method_channel_test.cc.
References error, fl_method_channel_invoke_method_finish(), fl_method_error_response_get_code(), fl_method_error_response_get_details(), fl_method_error_response_get_message(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, result, and user_data.
Referenced by TEST().
|
static |
Definition at line 175 of file fl_method_channel_test.cc.
References error, fl_method_channel_invoke_method_finish(), result, and user_data.
Referenced by TEST().
G_DECLARE_FINAL_TYPE | ( | TestMethodCodec | , |
test_method_codec | , | ||
TEST | , | ||
METHOD_CODEC | , | ||
FlMethodCodec | |||
) |
Definition at line 426 of file fl_method_channel_test.cc.
|
static |
Definition at line 279 of file fl_method_channel_test.cc.
References error, fl_method_call_get_args(), fl_method_call_get_name(), fl_method_call_respond_error(), fl_value_get_string(), fl_value_get_type(), fl_value_new_string(), FL_VALUE_TYPE_STRING, and method_call.
Referenced by TEST().
|
static |
Definition at line 567 of file fl_method_channel_test.cc.
References fl_method_call_respond_error(), fl_method_call_respond_not_implemented(), fl_value_new_int(), method_call, and user_data.
Referenced by TEST().
|
static |
Definition at line 297 of file fl_method_channel_test.cc.
References error, fl_binary_messenger_send_response(), fl_method_codec_decode_response(), fl_method_error_response_get_code(), fl_method_error_response_get_details(), fl_method_error_response_get_message(), fl_standard_method_codec_new(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, and user_data.
Referenced by TEST().
|
static |
Definition at line 359 of file fl_method_channel_test.cc.
References error, fl_method_call_get_args(), fl_method_call_get_name(), fl_method_call_respond_not_implemented(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, and method_call.
Referenced by TEST().
|
static |
Definition at line 375 of file fl_method_channel_test.cc.
References error, fl_binary_messenger_send_response(), fl_method_codec_decode_response(), fl_standard_method_codec_new(), and user_data.
Referenced by TEST().
|
static |
Definition at line 206 of file fl_method_channel_test.cc.
References error, fl_method_call_get_args(), fl_method_call_get_name(), fl_method_call_respond_success(), fl_value_get_string(), fl_value_get_type(), fl_value_new_string(), FL_VALUE_TYPE_STRING, method_call, and result.
Referenced by TEST().
|
static |
Definition at line 525 of file fl_method_channel_test.cc.
References fl_method_call_respond_not_implemented(), fl_method_call_respond_success(), fl_value_new_int(), method_call, result, and user_data.
Referenced by TEST().
|
static |
Definition at line 223 of file fl_method_channel_test.cc.
References error, fl_binary_messenger_send_response(), fl_method_codec_decode_response(), fl_method_success_response_get_result(), fl_standard_method_codec_new(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, result, and user_data.
Referenced by TEST().
|
static |
Definition at line 19 of file fl_method_channel_test.cc.
References error, fl_method_channel_invoke_method_finish(), fl_method_response_get_result(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, result, and user_data.
Referenced by TEST().
|
static |
Definition at line 142 of file fl_method_channel_test.cc.
References error, fl_method_channel_invoke_method_finish(), result, and user_data.
Referenced by TEST().
|
static |
Definition at line 58 of file fl_method_channel_test.cc.
References error, fl_method_channel_invoke_method_finish(), fl_method_response_get_result(), fl_value_get_type(), FL_VALUE_TYPE_NULL, result, and user_data.
Referenced by TEST().
|
static |
Definition at line 614 of file fl_method_channel_test.cc.
References error, fl_method_call_respond_success(), fl_value_new_string(), method_call, result, and user_data.
Referenced by TEST().
TEST | ( | FlMethodChannelTest | , |
DisposeAReplacedMethodChannel | |||
) |
Definition at line 693 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), UserDataReassignMethod::loop, make_mock_engine(), and reassign_method_cb().
TEST | ( | FlMethodChannelTest | , |
InvokeMethod | |||
) |
Definition at line 39 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_standard_method_codec_new(), fl_value_new_string(), make_mock_engine(), and method_response_cb().
TEST | ( | FlMethodChannelTest | , |
InvokeMethodError | |||
) |
Definition at line 120 of file fl_method_channel_test.cc.
References args, error_response_cb(), fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_standard_method_codec_new(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), and make_mock_engine().
TEST | ( | FlMethodChannelTest | , |
InvokeMethodFailure | |||
) |
Definition at line 188 of file fl_method_channel_test.cc.
References failure_response_cb(), fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_standard_method_codec_new(), and make_mock_engine().
TEST | ( | FlMethodChannelTest | , |
InvokeMethodNotImplemented | |||
) |
Definition at line 157 of file fl_method_channel_test.cc.
References fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_standard_method_codec_new(), make_mock_engine(), and not_implemented_response_cb().
TEST | ( | FlMethodChannelTest | , |
InvokeMethodNullptrArgsMessage | |||
) |
Definition at line 76 of file fl_method_channel_test.cc.
References fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_standard_method_codec_new(), make_mock_engine(), and nullptr_args_response_cb().
TEST | ( | FlMethodChannelTest | , |
ReceiveMethodCallRespondError | |||
) |
Definition at line 329 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_binary_messenger_set_message_handler_on_channel(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), make_mock_engine(), method_call_error_cb(), and method_call_error_response_cb().
TEST | ( | FlMethodChannelTest | , |
ReceiveMethodCallRespondErrorError | |||
) |
Definition at line 584 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), make_mock_engine(), method_call_error_error_cb(), and test_method_codec_new().
TEST | ( | FlMethodChannelTest | , |
ReceiveMethodCallRespondNotImplemented | |||
) |
Definition at line 397 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_binary_messenger_set_message_handler_on_channel(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), make_mock_engine(), method_call_not_implemented_cb(), and method_call_not_implemented_response_cb().
TEST | ( | FlMethodChannelTest | , |
ReceiveMethodCallRespondSuccess | |||
) |
Definition at line 249 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_binary_messenger_set_message_handler_on_channel(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), make_mock_engine(), method_call_success_cb(), and method_call_success_response_cb().
TEST | ( | FlMethodChannelTest | , |
ReceiveMethodCallRespondSuccessError | |||
) |
Definition at line 542 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), make_mock_engine(), method_call_success_error_cb(), and test_method_codec_new().
TEST | ( | FlMethodChannelTest | , |
ReplaceADisposedMethodChannel | |||
) |
Definition at line 636 of file fl_method_channel_test.cc.
References args, fl_binary_messenger_new(), fl_method_channel_invoke_method(), fl_method_channel_new(), fl_method_channel_set_method_call_handler(), fl_standard_method_codec_new(), fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), UserDataReassignMethod::loop, make_mock_engine(), and reassign_method_cb().
|
static |
Definition at line 501 of file fl_method_channel_test.cc.
References test_method_codec_decode_method_call(), test_method_codec_decode_response(), test_method_codec_dispose(), test_method_codec_encode_error_envelope(), test_method_codec_encode_method_call(), and test_method_codec_encode_success_envelope().
|
static |
Definition at line 460 of file fl_method_channel_test.cc.
References args, error, and fl_method_codec_decode_method_call().
Referenced by test_method_codec_class_init().
|
static |
Definition at line 492 of file fl_method_channel_test.cc.
References error, and fl_method_codec_decode_response().
Referenced by test_method_codec_class_init().
|
static |
Definition at line 440 of file fl_method_channel_test.cc.
Referenced by test_method_codec_class_init().
|
static |
Definition at line 481 of file fl_method_channel_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, and FL_MESSAGE_CODEC_ERROR_FAILED.
Referenced by test_method_codec_class_init().
|
static |
Definition at line 449 of file fl_method_channel_test.cc.
References args, error, and fl_method_codec_encode_method_call().
Referenced by test_method_codec_class_init().
|
static |
Definition at line 472 of file fl_method_channel_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, and FL_MESSAGE_CODEC_ERROR_FAILED.
Referenced by test_method_codec_class_init().
|
static |
Definition at line 515 of file fl_method_channel_test.cc.
References fl_standard_method_codec_new().
TestMethodCodec* test_method_codec_new | ( | ) |
Definition at line 519 of file fl_method_channel_test.cc.
Referenced by TEST().