#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_method_codec.h"
#include <cstring>
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_message_codec.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 | |
static gchar * | message_to_text (GBytes *message) |
static GBytes * | text_to_message (const gchar *text) |
static gchar * | encode_method_call (const gchar *name, FlValue *args) |
static gchar * | encode_success_envelope (FlValue *result) |
static gchar * | encode_error_envelope (const gchar *error_code, const gchar *error_message, FlValue *details) |
static void | decode_method_call (const char *text, gchar **name, FlValue **args) |
static void | decode_error_method_call (const char *text, GQuark domain, gint code) |
static void | decode_response_with_success (const char *text, FlValue *result) |
static void | decode_response_with_error (const char *text, const gchar *code, const gchar *error_message, FlValue *details) |
static void | decode_error_response (const char *text, GQuark domain, gint code) |
TEST (FlJsonMethodCodecTest, EncodeMethodCallNullptrArgs) | |
TEST (FlJsonMethodCodecTest, EncodeMethodCallNullArgs) | |
TEST (FlJsonMethodCodecTest, EncodeMethodCallStringArgs) | |
TEST (FlJsonMethodCodecTest, EncodeMethodCallListArgs) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallNoArgs) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallNullArgs) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallStringArgs) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallListArgs) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallNoData) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallNoMethodOrArgs) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallInvalidJson) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallWrongType) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallNoMethod) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallNoTerminator) | |
TEST (FlJsonMethodCodecTest, DecodeMethodCallExtraData) | |
TEST (FlJsonMethodCodecTest, EncodeSuccessEnvelopeNullptr) | |
TEST (FlJsonMethodCodecTest, EncodeSuccessEnvelopeNull) | |
TEST (FlJsonMethodCodecTest, EncodeSuccessEnvelopeString) | |
TEST (FlJsonMethodCodecTest, EncodeSuccessEnvelopeList) | |
|
static |
Definition at line 77 of file fl_json_method_codec_test.cc.
References args, error, fl_json_method_codec_new(), fl_method_codec_decode_method_call(), result, and text_to_message().
Referenced by TEST().
|
static |
Definition at line 146 of file fl_json_method_codec_test.cc.
References error, fl_json_method_codec_new(), fl_method_codec_decode_response(), and text_to_message().
|
static |
Definition at line 66 of file fl_json_method_codec_test.cc.
References args, error, fl_json_method_codec_new(), fl_method_codec_decode_method_call(), result, and text_to_message().
Referenced by TEST().
|
static |
Definition at line 110 of file fl_json_method_codec_test.cc.
References error, fl_json_method_codec_new(), fl_method_codec_decode_response(), fl_method_error_response_get_code(), fl_method_error_response_get_details(), fl_method_error_response_get_message(), fl_value_equal(), and text_to_message().
|
static |
Definition at line 94 of file fl_json_method_codec_test.cc.
References error, fl_json_method_codec_new(), fl_method_codec_decode_response(), fl_method_success_response_get_result(), fl_value_equal(), result, and text_to_message().
|
static |
Definition at line 52 of file fl_json_method_codec_test.cc.
References error, fl_json_method_codec_new(), fl_method_codec_encode_error_envelope(), and message_to_text().
|
static |
Definition at line 28 of file fl_json_method_codec_test.cc.
References args, error, fl_json_method_codec_new(), fl_method_codec_encode_method_call(), and message_to_text().
Referenced by TEST().
|
static |
Definition at line 40 of file fl_json_method_codec_test.cc.
References error, fl_json_method_codec_new(), fl_method_codec_encode_success_envelope(), message_to_text(), and result.
Referenced by TEST().
|
static |
Definition at line 15 of file fl_json_method_codec_test.cc.
Referenced by encode_error_envelope(), encode_method_call(), encode_success_envelope(), fl_test_codec_decode_method_call(), fl_test_codec_decode_response(), and TEST().
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallExtraData | |||
) |
Definition at line 255 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_JSON_MESSAGE_CODEC_ERROR, and FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallInvalidJson | |||
) |
Definition at line 234 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_JSON_MESSAGE_CODEC_ERROR, and FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallListArgs | |||
) |
Definition at line 206 of file fl_json_method_codec_test.cc.
References args, decode_method_call(), fl_value_get_int(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_string(), fl_value_get_type(), FL_VALUE_TYPE_INT, FL_VALUE_TYPE_LIST, and FL_VALUE_TYPE_STRING.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallNoArgs | |||
) |
Definition at line 181 of file fl_json_method_codec_test.cc.
References args, and decode_method_call().
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallNoData | |||
) |
Definition at line 224 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_JSON_MESSAGE_CODEC_ERROR, and FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallNoMethod | |||
) |
Definition at line 244 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_MESSAGE_CODEC_ERROR, and FL_MESSAGE_CODEC_ERROR_FAILED.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallNoMethodOrArgs | |||
) |
Definition at line 229 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_MESSAGE_CODEC_ERROR, and FL_MESSAGE_CODEC_ERROR_FAILED.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallNoTerminator | |||
) |
Definition at line 249 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_JSON_MESSAGE_CODEC_ERROR, and FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallNullArgs | |||
) |
Definition at line 189 of file fl_json_method_codec_test.cc.
References args, decode_method_call(), fl_value_get_type(), and FL_VALUE_TYPE_NULL.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallStringArgs | |||
) |
Definition at line 197 of file fl_json_method_codec_test.cc.
References args, decode_method_call(), fl_value_get_string(), fl_value_get_type(), and FL_VALUE_TYPE_STRING.
TEST | ( | FlJsonMethodCodecTest | , |
DecodeMethodCallWrongType | |||
) |
Definition at line 239 of file fl_json_method_codec_test.cc.
References decode_error_method_call(), FL_MESSAGE_CODEC_ERROR, and FL_MESSAGE_CODEC_ERROR_FAILED.
TEST | ( | FlJsonMethodCodecTest | , |
EncodeMethodCallListArgs | |||
) |
Definition at line 173 of file fl_json_method_codec_test.cc.
References args, encode_method_call(), fl_value_append_take(), fl_value_new_int(), fl_value_new_list(), and fl_value_new_string().
TEST | ( | FlJsonMethodCodecTest | , |
EncodeMethodCallNullArgs | |||
) |
Definition at line 161 of file fl_json_method_codec_test.cc.
References encode_method_call(), fl_value_new_null(), and value.
TEST | ( | FlJsonMethodCodecTest | , |
EncodeMethodCallNullptrArgs | |||
) |
TEST | ( | FlJsonMethodCodecTest | , |
EncodeMethodCallStringArgs | |||
) |
Definition at line 167 of file fl_json_method_codec_test.cc.
References args, encode_method_call(), and fl_value_new_string().
TEST | ( | FlJsonMethodCodecTest | , |
EncodeSuccessEnvelopeList | |||
) |
Definition at line 278 of file fl_json_method_codec_test.cc.
References encode_success_envelope(), fl_value_append_take(), fl_value_new_int(), fl_value_new_list(), fl_value_new_string(), and result.
TEST | ( | FlJsonMethodCodecTest | , |
EncodeSuccessEnvelopeNull | |||
) |
Definition at line 266 of file fl_json_method_codec_test.cc.
References encode_success_envelope(), fl_value_new_null(), and result.
TEST | ( | FlJsonMethodCodecTest | , |
EncodeSuccessEnvelopeNullptr | |||
) |
TEST | ( | FlJsonMethodCodecTest | , |
EncodeSuccessEnvelopeString | |||
) |
Definition at line 272 of file fl_json_method_codec_test.cc.
References encode_success_envelope(), fl_value_new_string(), and result.
|
static |
Definition at line 23 of file fl_json_method_codec_test.cc.
Referenced by decode_error_method_call(), decode_error_response(), decode_method_call(), decode_response_with_error(), and decode_response_with_success().