#include <utility>
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
#include "flutter/shell/platform/linux/fl_text_input_handler.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_binary_messenger.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_method_codec.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"
#include "flutter/shell/platform/linux/testing/fl_test.h"
#include "flutter/shell/platform/linux/testing/mock_binary_messenger.h"
#include "flutter/shell/platform/linux/testing/mock_binary_messenger_response_handle.h"
#include "flutter/shell/platform/linux/testing/mock_im_context.h"
#include "flutter/shell/platform/linux/testing/mock_text_input_view_delegate.h"
#include "flutter/testing/testing.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Go to the source code of this file.
Classes | |
class | MethodCallMatcher |
struct | InputConfig |
struct | EditingState |
struct | EditingDelta |
Functions | |
void | printTo (FlMethodResponse *response, ::std::ostream *os) |
MATCHER_P (SuccessResponse, result, "") | |
MATCHER_P (FlValueEq, value, "equal to "+::testing::PrintToString(value)) | |
::testing::Matcher< GBytes * > | MethodCall (const std::string &name, ::testing::Matcher< FlValue * > args) |
static FlValue * | build_map (std::map< const gchar *, FlValue * > args) |
static FlValue * | build_list (std::vector< FlValue * > args) |
static FlValue * | build_input_config (InputConfig config) |
static FlValue * | build_editing_state (EditingState state) |
static FlValue * | build_editing_delta (EditingDelta delta) |
static void | send_key_event (FlTextInputHandler *handler, gint keyval, gint state=0) |
TEST (FlTextInputHandlerTest, MessageHandler) | |
TEST (FlTextInputHandlerTest, SetClient) | |
TEST (FlTextInputHandlerTest, Show) | |
TEST (FlTextInputHandlerTest, Hide) | |
TEST (FlTextInputHandlerTest, ClearClient) | |
TEST (FlTextInputHandlerTest, PerformAction) | |
TEST (FlTextInputHandlerTest, MultilineWithSendAction) | |
TEST (FlTextInputHandlerTest, MoveCursor) | |
TEST (FlTextInputHandlerTest, Select) | |
TEST (FlTextInputHandlerTest, Composing) | |
TEST (FlTextInputHandlerTest, SurroundingText) | |
TEST (FlTextInputHandlerTest, SetMarkedTextRect) | |
TEST (FlTextInputHandlerTest, TextInputTypeNone) | |
TEST (FlTextInputHandlerTest, TextEditingDelta) | |
TEST (FlTextInputHandlerTest, ComposingDelta) | |
TEST (FlTextInputHandlerTest, NonComposingDelta) | |
|
static |
Definition at line 166 of file fl_text_input_handler_test.cc.
References build_map(), EditingDelta::composing_base, EditingDelta::composing_extent, EditingDelta::delta_end, EditingDelta::delta_start, EditingDelta::delta_text, fl_value_new_bool(), fl_value_new_int(), fl_value_new_string(), EditingDelta::old_text, EditingDelta::selection_base, and EditingDelta::selection_extent.
Referenced by TEST().
|
static |
Definition at line 143 of file fl_text_input_handler_test.cc.
References build_map(), fl_value_new_bool(), fl_value_new_int(), fl_value_new_string(), and state.
Referenced by TEST().
|
static |
Definition at line 122 of file fl_text_input_handler_test.cc.
References build_list(), build_map(), InputConfig::client_id, InputConfig::enable_delta_model, fl_value_new_bool(), fl_value_new_int(), fl_value_new_string(), InputConfig::input_action, and InputConfig::input_type.
Referenced by TEST().
Definition at line 107 of file fl_text_input_handler_test.cc.
References args, fl_value_append_take(), fl_value_new_list(), and value.
Referenced by build_input_config(), and TEST().
Definition at line 99 of file fl_text_input_handler_test.cc.
References args, fl_value_new_map(), fl_value_set_string_take(), and value.
Referenced by build_editing_delta(), build_editing_state(), build_input_config(), and TEST().
MATCHER_P | ( | FlValueEq | , |
value | , | ||
"equal to "+ | ::testing::PrintToStringvalue | ||
) |
Definition at line 39 of file fl_text_input_handler_test.cc.
References fl_value_equal(), and value.
MATCHER_P | ( | SuccessResponse | , |
result | , | ||
"" | |||
) |
Definition at line 27 of file fl_text_input_handler_test.cc.
References fl_json_method_codec_new(), fl_method_codec_decode_response(), fl_method_response_get_result(), fl_value_equal(), and result.
::testing::Matcher<GBytes*> MethodCall | ( | const std::string & | name, |
::testing::Matcher< FlValue * > | args | ||
) |
void printTo | ( | FlMethodResponse * | response, |
::std::ostream * | os | ||
) |
Definition at line 22 of file fl_text_input_handler_test.cc.
References fl_method_response_get_result().
|
static |
Definition at line 181 of file fl_text_input_handler_test.cc.
References fl_key_event_new_from_gdk_event(), fl_text_input_handler_filter_keypress(), and state.
Referenced by fl_key_embedder_responder_new(), and TEST().
TEST | ( | FlTextInputHandlerTest | , |
ClearClient | |||
) |
Definition at line 276 of file fl_text_input_handler_test.cc.
References fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), and fl_value_new_null().
TEST | ( | FlTextInputHandlerTest | , |
Composing | |||
) |
Definition at line 595 of file fl_text_input_handler_test.cc.
References build_editing_state(), build_list(), fl_binary_messenger_send_on_channel(), fl_text_input_handler_new(), fl_value_new_int(), MethodCall(), and state.
TEST | ( | FlTextInputHandlerTest | , |
ComposingDelta | |||
) |
Definition at line 933 of file fl_text_input_handler_test.cc.
References args, build_editing_delta(), build_input_config(), build_list(), build_map(), end, fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), and set_client().
TEST | ( | FlTextInputHandlerTest | , |
Hide | |||
) |
Definition at line 251 of file fl_text_input_handler_test.cc.
References fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), and fl_value_new_null().
TEST | ( | FlTextInputHandlerTest | , |
MessageHandler | |||
) |
Definition at line 191 of file fl_text_input_handler_test.cc.
References fl_text_input_handler_new().
TEST | ( | FlTextInputHandlerTest | , |
MoveCursor | |||
) |
Definition at line 439 of file fl_text_input_handler_test.cc.
References build_editing_state(), build_input_config(), build_list(), end, fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputHandlerTest | , |
MultilineWithSendAction | |||
) |
Definition at line 375 of file fl_text_input_handler_test.cc.
References build_editing_state(), build_input_config(), build_list(), fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), fl_value_new_string(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputHandlerTest | , |
NonComposingDelta | |||
) |
Definition at line 1056 of file fl_text_input_handler_test.cc.
References args, build_editing_delta(), build_input_config(), build_list(), build_map(), fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), and set_client().
TEST | ( | FlTextInputHandlerTest | , |
PerformAction | |||
) |
Definition at line 298 of file fl_text_input_handler_test.cc.
References build_editing_state(), build_input_config(), build_list(), fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), fl_value_new_string(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputHandlerTest | , |
Select | |||
) |
Definition at line 517 of file fl_text_input_handler_test.cc.
References build_editing_state(), build_input_config(), build_list(), fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputHandlerTest | , |
SetClient | |||
) |
Definition at line 203 of file fl_text_input_handler_test.cc.
References args, build_input_config(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), and fl_value_new_null().
TEST | ( | FlTextInputHandlerTest | , |
SetMarkedTextRect | |||
) |
Definition at line 735 of file fl_text_input_handler_test.cc.
References build_list(), build_map(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_text_input_view_delegate_translate_coordinates(), fl_value_new_float(), fl_value_new_null(), height, set_editable_size_and_transform(), set_marked_text_rect(), and width.
TEST | ( | FlTextInputHandlerTest | , |
Show | |||
) |
Definition at line 226 of file fl_text_input_handler_test.cc.
References fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), and fl_value_new_null().
TEST | ( | FlTextInputHandlerTest | , |
SurroundingText | |||
) |
Definition at line 665 of file fl_text_input_handler_test.cc.
References build_editing_state(), build_input_config(), build_list(), fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), set_client(), and state.
TEST | ( | FlTextInputHandlerTest | , |
TextEditingDelta | |||
) |
Definition at line 861 of file fl_text_input_handler_test.cc.
References args, build_editing_delta(), build_editing_state(), build_input_config(), build_list(), build_map(), fl_binary_messenger_send_on_channel(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputHandlerTest | , |
TextInputTypeNone | |||
) |
Definition at line 818 of file fl_text_input_handler_test.cc.
References args, build_input_config(), fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_handler_new(), fl_value_new_null(), set_client(), and show().