5#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_KEYBOARD_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_TEST_KEYBOARD_H_
13#include "flutter/fml/macros.h"
14#include "flutter/shell/platform/embedder/embedder.h"
15#include "flutter/shell/platform/windows/testing/engine_modifier.h"
16#include "flutter/shell/platform/windows/testing/wm_builders.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);
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);
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)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
void(* FlutterDesktopBinaryReply)(const uint8_t *data, size_t data_size, void *user_data)
Dart_NativeFunction function
::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)