#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_codec.h"
#include <cstring>
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_message_codec.h"
#include "gtest/gtest.h"
Go to the source code of this file.
Functions | |
G_DECLARE_FINAL_TYPE (FlTestMethodCodec, fl_test_method_codec, FL, TEST_METHOD_CODEC, FlMethodCodec) struct _FlTestMethodCodec | |
G_DEFINE_TYPE (FlTestMethodCodec, fl_test_method_codec, fl_method_codec_get_type()) static gchar *message_to_text(GBytes *message) | |
static GBytes * | text_to_message (const gchar *text) |
static GBytes * | fl_test_codec_encode_method_call (FlMethodCodec *codec, const gchar *name, FlValue *args, GError **error) |
static gboolean | fl_test_codec_decode_method_call (FlMethodCodec *codec, GBytes *message, gchar **name, FlValue **args, GError **error) |
static GBytes * | fl_test_codec_encode_success_envelope (FlMethodCodec *codec, FlValue *result, GError **error) |
static GBytes * | fl_test_codec_encode_error_envelope (FlMethodCodec *codec, const gchar *code, const gchar *message, FlValue *details, GError **error) |
static FlMethodResponse * | fl_test_codec_decode_response (FlMethodCodec *codec, GBytes *message, GError **error) |
static void | fl_test_method_codec_class_init (FlTestMethodCodecClass *klass) |
static void | fl_test_method_codec_init (FlTestMethodCodec *self) |
static FlTestMethodCodec * | fl_test_method_codec_new () |
TEST (FlMethodCodecTest, EncodeMethodCall) | |
TEST (FlMethodCodecTest, EncodeMethodCallEmptyName) | |
TEST (FlMethodCodecTest, EncodeMethodCallArgs) | |
TEST (FlMethodCodecTest, EncodeMethodCallError) | |
TEST (FlMethodCodecTest, DecodeMethodCall) | |
TEST (FlMethodCodecTest, EncodeSuccessEnvelope) | |
TEST (FlMethodCodecTest, EncodeSuccessEnvelopeEmpty) | |
TEST (FlMethodCodecTest, EncodeSuccessEnvelopeError) | |
TEST (FlMethodCodecTest, EncodeErrorEnvelopeNoMessageOrDetails) | |
TEST (FlMethodCodecTest, EncodeErrorEnvelopeMessage) | |
TEST (FlMethodCodecTest, EncodeErrorEnvelopeDetails) | |
TEST (FlMethodCodecTest, EncodeErrorEnvelopeMessageAndDetails) | |
TEST (FlMethodCodecTest, DecodeResponseSuccess) | |
TEST (FlMethodCodecTest, DecodeResponseNotImplemented) | |
TEST (FlMethodCodecTest, DecodeResponseCodecError) | |
TEST (FlMethodCodecTest, DecodeResponseError) | |
|
static |
Definition at line 65 of file fl_method_codec_test.cc.
References args, error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_value_new_null(), message_to_text(), and TRUE.
Referenced by fl_test_method_codec_class_init().
|
static |
Definition at line 142 of file fl_method_codec_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_method_error_response_new(), fl_method_success_response_new(), fl_value_new_int(), fl_value_new_string(), message_to_text(), and result.
Referenced by fl_test_method_codec_class_init().
|
static |
Definition at line 106 of file fl_method_codec_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_value_get_int(), fl_value_get_type(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_NULL, and text_to_message().
Referenced by fl_test_method_codec_class_init().
|
static |
Definition at line 43 of file fl_method_codec_test.cc.
References args, error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_value_get_int(), fl_value_get_type(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_NULL, and text_to_message().
Referenced by fl_test_method_codec_class_init().
|
static |
Definition at line 86 of file fl_method_codec_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_value_get_int(), fl_value_get_type(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_NULL, result, and text_to_message().
Referenced by fl_test_method_codec_class_init().
|
static |
Definition at line 162 of file fl_method_codec_test.cc.
References fl_test_codec_decode_method_call(), fl_test_codec_decode_response(), fl_test_codec_encode_error_envelope(), fl_test_codec_encode_method_call(), and fl_test_codec_encode_success_envelope().
|
static |
Definition at line 174 of file fl_method_codec_test.cc.
|
static |
G_DECLARE_FINAL_TYPE | ( | FlTestMethodCodec | , |
fl_test_method_codec | , | ||
FL | , | ||
TEST_METHOD_CODEC | , | ||
FlMethodCodec | |||
) |
Definition at line 13 of file fl_method_codec_test.cc.
G_DEFINE_TYPE | ( | FlTestMethodCodec | , |
fl_test_method_codec | , | ||
fl_method_codec_get_type() | |||
) |
Definition at line 25 of file fl_method_codec_test.cc.
TEST | ( | FlMethodCodecTest | , |
DecodeMethodCall | |||
) |
Definition at line 233 of file fl_method_codec_test.cc.
References args, error, fl_method_codec_decode_method_call(), fl_test_method_codec_new(), fl_value_get_type(), FL_VALUE_TYPE_NULL, result, and text_to_message().
TEST | ( | FlMethodCodecTest | , |
DecodeResponseCodecError | |||
) |
Definition at line 374 of file fl_method_codec_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_method_codec_decode_response(), fl_test_method_codec_new(), and text_to_message().
TEST | ( | FlMethodCodecTest | , |
DecodeResponseError | |||
) |
Definition at line 387 of file fl_method_codec_test.cc.
References error, fl_method_codec_decode_response(), fl_method_error_response_get_code(), fl_method_error_response_get_details(), fl_method_error_response_get_message(), fl_test_method_codec_new(), fl_value_get_int(), fl_value_get_type(), FL_VALUE_TYPE_INT, and text_to_message().
TEST | ( | FlMethodCodecTest | , |
DecodeResponseNotImplemented | |||
) |
Definition at line 361 of file fl_method_codec_test.cc.
References error, fl_method_codec_decode_response(), and fl_test_method_codec_new().
TEST | ( | FlMethodCodecTest | , |
DecodeResponseSuccess | |||
) |
Definition at line 343 of file fl_method_codec_test.cc.
References error, fl_method_codec_decode_response(), fl_method_success_response_get_result(), fl_test_method_codec_new(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_STRING, result, and text_to_message().
TEST | ( | FlMethodCodecTest | , |
EncodeErrorEnvelopeDetails | |||
) |
Definition at line 315 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_error_envelope(), fl_test_method_codec_new(), fl_value_new_int(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeErrorEnvelopeMessage | |||
) |
Definition at line 302 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_error_envelope(), fl_test_method_codec_new(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeErrorEnvelopeMessageAndDetails | |||
) |
Definition at line 329 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_error_envelope(), fl_test_method_codec_new(), fl_value_new_int(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeErrorEnvelopeNoMessageOrDetails | |||
) |
Definition at line 289 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_error_envelope(), fl_test_method_codec_new(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeMethodCall | |||
) |
Definition at line 181 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_method_call(), fl_test_method_codec_new(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeMethodCallArgs | |||
) |
Definition at line 207 of file fl_method_codec_test.cc.
References args, error, fl_method_codec_encode_method_call(), fl_test_method_codec_new(), fl_value_new_int(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeMethodCallEmptyName | |||
) |
Definition at line 194 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_method_call(), fl_test_method_codec_new(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeMethodCallError | |||
) |
Definition at line 221 of file fl_method_codec_test.cc.
References args, error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_method_codec_encode_method_call(), fl_test_method_codec_new(), and fl_value_new_bool().
TEST | ( | FlMethodCodecTest | , |
EncodeSuccessEnvelope | |||
) |
Definition at line 250 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_success_envelope(), fl_test_method_codec_new(), fl_value_new_int(), message_to_text(), and result.
TEST | ( | FlMethodCodecTest | , |
EncodeSuccessEnvelopeEmpty | |||
) |
Definition at line 264 of file fl_method_codec_test.cc.
References error, fl_method_codec_encode_success_envelope(), fl_test_method_codec_new(), and message_to_text().
TEST | ( | FlMethodCodecTest | , |
EncodeSuccessEnvelopeError | |||
) |
Definition at line 277 of file fl_method_codec_test.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_FAILED, fl_method_codec_encode_success_envelope(), fl_test_method_codec_new(), fl_value_new_string(), and result.
|
static |
Definition at line 38 of file fl_method_codec_test.cc.
Referenced by fl_test_codec_encode_error_envelope(), fl_test_codec_encode_method_call(), fl_test_codec_encode_success_envelope(), and TEST().