#include <utility>
#include "flutter/shell/platform/linux/fl_method_codec_private.h"
#include "flutter/shell/platform/linux/fl_text_input_plugin.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 (FlTextInputPlugin *plugin, gint keyval, gint state=0) |
TEST (FlTextInputPluginTest, MessageHandler) | |
TEST (FlTextInputPluginTest, SetClient) | |
TEST (FlTextInputPluginTest, Show) | |
TEST (FlTextInputPluginTest, Hide) | |
TEST (FlTextInputPluginTest, ClearClient) | |
TEST (FlTextInputPluginTest, PerformAction) | |
TEST (FlTextInputPluginTest, MultilineWithSendAction) | |
TEST (FlTextInputPluginTest, MoveCursor) | |
TEST (FlTextInputPluginTest, Select) | |
TEST (FlTextInputPluginTest, Composing) | |
TEST (FlTextInputPluginTest, SurroundingText) | |
TEST (FlTextInputPluginTest, SetMarkedTextRect) | |
TEST (FlTextInputPluginTest, TextInputTypeNone) | |
TEST (FlTextInputPluginTest, TextEditingDelta) | |
TEST (FlTextInputPluginTest, ComposingDelta) | |
TEST (FlTextInputPluginTest, NonComposingDelta) | |
|
static |
Definition at line 166 of file fl_text_input_plugin_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_plugin_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_plugin_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_plugin_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_plugin_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_plugin_test.cc.
References fl_value_equal(), and value.
MATCHER_P | ( | SuccessResponse | , |
result | , | ||
"" | |||
) |
Definition at line 27 of file fl_text_input_plugin_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_plugin_test.cc.
References fl_method_response_get_result().
|
static |
Definition at line 181 of file fl_text_input_plugin_test.cc.
References fl_key_event_dispose(), fl_key_event_new_from_gdk_event(), fl_text_input_plugin_filter_keypress(), and state.
Referenced by fl_key_embedder_responder_new(), and TEST().
TEST | ( | FlTextInputPluginTest | , |
ClearClient | |||
) |
Definition at line 277 of file fl_text_input_plugin_test.cc.
References fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_plugin_new(), and fl_value_new_null().
TEST | ( | FlTextInputPluginTest | , |
Composing | |||
) |
Definition at line 596 of file fl_text_input_plugin_test.cc.
References build_editing_state(), build_list(), fl_binary_messenger_send_on_channel(), fl_text_input_plugin_new(), fl_value_new_int(), MethodCall(), and state.
TEST | ( | FlTextInputPluginTest | , |
ComposingDelta | |||
) |
Definition at line 934 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), and set_client().
TEST | ( | FlTextInputPluginTest | , |
Hide | |||
) |
Definition at line 252 of file fl_text_input_plugin_test.cc.
References fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_plugin_new(), and fl_value_new_null().
TEST | ( | FlTextInputPluginTest | , |
MessageHandler | |||
) |
TEST | ( | FlTextInputPluginTest | , |
MoveCursor | |||
) |
Definition at line 440 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputPluginTest | , |
MultilineWithSendAction | |||
) |
Definition at line 376 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), fl_value_new_string(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputPluginTest | , |
NonComposingDelta | |||
) |
Definition at line 1057 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), and set_client().
TEST | ( | FlTextInputPluginTest | , |
PerformAction | |||
) |
Definition at line 299 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), fl_value_new_string(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputPluginTest | , |
Select | |||
) |
Definition at line 518 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputPluginTest | , |
SetClient | |||
) |
Definition at line 204 of file fl_text_input_plugin_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_plugin_new(), and fl_value_new_null().
TEST | ( | FlTextInputPluginTest | , |
SetMarkedTextRect | |||
) |
Definition at line 736 of file fl_text_input_plugin_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_plugin_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 | ( | FlTextInputPluginTest | , |
Show | |||
) |
Definition at line 227 of file fl_text_input_plugin_test.cc.
References fl_binary_messenger_send_response(), fl_json_method_codec_new(), fl_method_codec_encode_method_call(), fl_text_input_plugin_new(), and fl_value_new_null().
TEST | ( | FlTextInputPluginTest | , |
SurroundingText | |||
) |
Definition at line 666 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), set_client(), and state.
TEST | ( | FlTextInputPluginTest | , |
TextEditingDelta | |||
) |
Definition at line 862 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_int(), fl_value_new_null(), MethodCall(), send_key_event(), set_client(), and state.
TEST | ( | FlTextInputPluginTest | , |
TextInputTypeNone | |||
) |
Definition at line 819 of file fl_text_input_plugin_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_plugin_new(), fl_value_new_null(), set_client(), and show().