5#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_KEYBOARD_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_KEYBOARD_H_
18#include "gtest/gtest.h"
27::testing::AssertionResult
_EventEquals(
const char* expr_event,
28 const char* expr_expected,
46 USHORT repeat_count = 1,
47 bool context_code = 0,
48 bool transition_state = 1);
57 std::function<void(std::unique_ptr<rapidjson::Document>)>;
60 : channel_response_(ChannelRespondFalse),
61 embedder_response_(EmbedderRespondFalse),
63 [](
std::unique_ptr<rapidjson::Document> document) {}) {}
66 channel_response_ = std::move(
handler);
70 embedder_response_ = std::move(
handler);
74 text_input_response_ = std::move(
handler);
83 embedder_response_(event, std::move(
callback));
87 text_input_response_(std::move(document));
108 EngineModifier& modifier,
109 std::shared_ptr<MockKeyResponseController> response_controller);
146#define EXPECT_EVENT_EQUALS(_target, _type, _physical, _logical, _character, \
148 EXPECT_PRED_FORMAT2( \
149 _EventEquals, _target, \
151 sizeof(FlutterKeyEvent), \
158 kFlutterKeyEventDeviceTypeKeyboard, \
void HandleChannelMessage(ResponseCallback callback)
std::function< void(const FlutterKeyEvent *, ResponseCallback)> EmbedderCallbackHandler
void SetEmbedderResponse(EmbedderCallbackHandler handler)
MockKeyResponseController()
void SetChannelResponse(ChannelCallbackHandler handler)
void SetTextInputResponse(TextInputCallbackHandler handler)
std::function< void(ResponseCallback)> ChannelCallbackHandler
std::function< void(std::unique_ptr< rapidjson::Document >)> TextInputCallbackHandler
void HandleTextInputMessage(std::unique_ptr< rapidjson::Document > document)
void HandleEmbedderMessage(const FlutterKeyEvent *event, ResponseCallback callback)
std::function< void(bool)> ResponseCallback
std::list< Win32Message > _pending_messages
std::list< Win32Message > _sent_messages
void PushBack(const Win32Message *message)
virtual LRESULT Win32SendMessage(UINT const message, WPARAM const wparam, LPARAM const lparam)=0
BOOL Win32PeekMessage(LPMSG lpMsg, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
const gchar FlBinaryMessengerMessageHandler handler
G_BEGIN_DECLS GBytes * message
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
FlutterDesktopBinaryReply callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
::testing::AssertionResult _EventEquals(const char *expr_event, const char *expr_expected, const FlutterKeyEvent &event, const FlutterKeyEvent &expected)
void MockEmbedderApiForKeyboard(EngineModifier &modifier, std::shared_ptr< MockKeyResponseController > response_controller)
LPARAM CreateKeyEventLparam(USHORT scancode, bool extended, bool was_down, USHORT repeat_count, bool context_code, bool transition_state)
char * clone_string(const char *string)