Flutter Windows Embedder
keyboard_unittests.cc File Reference
#include "flutter/fml/logging.h"
#include "flutter/shell/platform/common/json_message_codec.h"
#include "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/embedder/test_utils/key_codes.g.h"
#include "flutter/shell/platform/windows/flutter_windows_engine.h"
#include "flutter/shell/platform/windows/flutter_windows_view.h"
#include "flutter/shell/platform/windows/keyboard_key_channel_handler.h"
#include "flutter/shell/platform/windows/keyboard_key_embedder_handler.h"
#include "flutter/shell/platform/windows/keyboard_key_handler.h"
#include "flutter/shell/platform/windows/keyboard_manager.h"
#include "flutter/shell/platform/windows/testing/engine_modifier.h"
#include "flutter/shell/platform/windows/testing/flutter_windows_engine_builder.h"
#include "flutter/shell/platform/windows/testing/mock_window_binding_handler.h"
#include "flutter/shell/platform/windows/testing/test_keyboard.h"
#include "flutter/shell/platform/windows/testing/windows_test.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "rapidjson/stringbuffer.h"
#include "rapidjson/writer.h"
#include <functional>
#include <list>
#include <vector>

Go to the source code of this file.

Namespaces

 flutter
 
 flutter::testing
 

Macros

#define EXPECT_CALL_IS_EVENT(_key_call, _type, _physical, _logical, _character, _synthesized)
 
#define EXPECT_CALL_IS_TEXT(_key_call, u16_string)
 
#define EXPECT_CALL_IS_TEXT_METHOD_CALL(_key_call, json_string)
 

Functions

 flutter::testing::TEST_F (KeyboardTest, LowerCaseAHandled)
 
 flutter::testing::TEST_F (KeyboardTest, LowerCaseAUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, ArrowLeftHandled)
 
 flutter::testing::TEST_F (KeyboardTest, ArrowLeftUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, ShiftLeftUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, ShiftRightUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, CtrlLeftUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, CtrlRightUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, AltLeftUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, AltRightUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, MetaLeftUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, MetaRightUnhandled)
 
 flutter::testing::TEST_F (KeyboardTest, RepeatA)
 
 flutter::testing::TEST_F (KeyboardTest, RestartClearsKeyboardState)
 
 flutter::testing::TEST_F (KeyboardTest, ShiftLeftKeyA)
 
 flutter::testing::TEST_F (KeyboardTest, CtrlLeftKeyA)
 
 flutter::testing::TEST_F (KeyboardTest, CtrlLeftDigit1)
 
 flutter::testing::TEST_F (KeyboardTest, Digit1OnFrenchLayout)
 
 flutter::testing::TEST_F (KeyboardTest, AltGrModifiedKey)
 
 flutter::testing::TEST_F (KeyboardTest, AltGrTwice)
 
 flutter::testing::TEST_F (KeyboardTest, DeadKeyThatCombines)
 
 flutter::testing::TEST_F (KeyboardTest, DeadKeyWithoutDeadMaskThatCombines)
 
 flutter::testing::TEST_F (KeyboardTest, DeadKeyThatDoesNotCombine)
 
 flutter::testing::TEST_F (KeyboardTest, DeadKeyTwiceThenLetter)
 
 flutter::testing::TEST_F (KeyboardTest, MultibyteCharacter)
 
 flutter::testing::TEST_F (KeyboardTest, SynthesizeModifiers)
 
 flutter::testing::TEST_F (KeyboardTest, ImeExtendedEventsAreIgnored)
 
 flutter::testing::TEST_F (KeyboardTest, UpOnlyImeEventsAreCorrectlyHandled)
 
 flutter::testing::TEST_F (KeyboardTest, SlowFrameworkResponse)
 
 flutter::testing::TEST_F (KeyboardTest, SlowFrameworkResponseForIdenticalEvents)
 
 flutter::testing::TEST_F (KeyboardTest, TextInputSubmit)
 
 flutter::testing::TEST_F (KeyboardTest, VietnameseTelexAddDiacriticWithFastResponse)
 
void flutter::testing::VietnameseTelexAddDiacriticWithSlowResponse (WindowsTestContext &context, bool backspace_response)
 
 flutter::testing::TEST_F (KeyboardTest, VietnameseTelexAddDiacriticWithSlowFalseResponse)
 
 flutter::testing::TEST_F (KeyboardTest, VietnameseTelexAddDiacriticWithSlowTrueResponse)
 
 flutter::testing::TEST_F (KeyboardTest, DoubleCapsLock)
 

Macro Definition Documentation

◆ EXPECT_CALL_IS_EVENT

#define EXPECT_CALL_IS_EVENT (   _key_call,
  _type,
  _physical,
  _logical,
  _character,
  _synthesized 
)
Value:
EXPECT_EQ(_key_call.type, KeyCall::kKeyCallOnKey); \
EXPECT_EVENT_EQUALS(_key_call.key_event, _type, _physical, _logical, \
_character, _synthesized);

Definition at line 554 of file keyboard_unittests.cc.

◆ EXPECT_CALL_IS_TEXT

#define EXPECT_CALL_IS_TEXT (   _key_call,
  u16_string 
)
Value:
EXPECT_EQ(_key_call.type, KeyCall::kKeyCallOnText); \
EXPECT_EQ(_key_call.text, u16_string);

Definition at line 560 of file keyboard_unittests.cc.

◆ EXPECT_CALL_IS_TEXT_METHOD_CALL

#define EXPECT_CALL_IS_TEXT_METHOD_CALL (   _key_call,
  json_string 
)
Value:
EXPECT_EQ(_key_call.type, KeyCall::kKeyCallTextMethodCall); \
EXPECT_STREQ(_key_call.text_method_call.c_str(), json_string);

Definition at line 564 of file keyboard_unittests.cc.

Variable Documentation

◆ content

◆ expected_forged_message

Win32Message expected_forged_message

Definition at line 167 of file keyboard_unittests.cc.

◆ key

uint32_t key

Definition at line 125 of file keyboard_unittests.cc.

◆ key_calls

std::vector<KeyCall> key_calls

Definition at line 463 of file keyboard_unittests.cc.

◆ key_event

FlutterKeyEvent key_event

Definition at line 331 of file keyboard_unittests.cc.

◆ key_state_change

KeyStateChange key_state_change

Definition at line 166 of file keyboard_unittests.cc.

◆ message

Win32Message message

Definition at line 137 of file keyboard_unittests.cc.

Referenced by flutter::AccessibilityPlugin::Announce(), flutter::JsonMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), flutter::StandardMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), flutter::MethodCodec< rapidjson::Document >::DecodeMethodCall(), flutter::JsonMethodCodec::DecodeMethodCallInternal(), flutter::StandardMethodCodec::DecodeMethodCallInternal(), flutter::WindowsLifecycleManager::DispatchMessage(), flutter::MessageCodec< rapidjson::Document >::EncodeMessage(), flutter::JsonMessageCodec::EncodeMessageInternal(), flutter::StandardMessageCodec::EncodeMessageInternal(), flutter::JsonMethodCodec::EncodeMethodCallInternal(), flutter::WindowsLifecycleManager::ExternalWindowMessage(), FlutterDesktopEngineProcessExternalWindowMessage(), FlutterDesktopMessengerSend(), FlutterDesktopMessengerSendWithReply(), FlutterDesktopViewControllerHandleTopLevelWindowProc(), flutter::IncomingMessageDispatcher::HandleMessage(), flutter::KeyboardManager::HandleMessage(), flutter::FlutterWindow::HandleMessage(), flutter::FlutterWindowsEngine::HandlePlatformMessage(), flutter::FlutterViewController::HandleTopLevelWindowProc(), flutter::FlutterWindow::InitializeChild(), flutter::MethodChannel< T >::InvokeMethod(), flutter::egl::LogEGLError(), flutter::WindowProcDelegateManager::OnTopLevelWindowProc(), flutter::FlutterEngine::ProcessExternalWindowMessage(), flutter::FlutterWindowsEngine::ProcessExternalWindowMessage(), flutter::KeyboardManager::RedispatchEvent(), flutter::BinaryMessengerImpl::Send(), flutter::BasicMessageChannel< T >::Send(), flutter::internal::ReplyManager::SendResponseData(), flutter::BasicMessageChannel< T >::SetMessageHandler(), flutter::MethodChannel< T >::SetMethodCallHandler(), flutter::EventChannel< T >::SetStreamHandler(), flutter::AccessibilityPlugin::SetUp(), flutter::testing::TEST(), flutter::TEST(), flutter::testing::TEST_F(), and flutter::DirectManipulationOwner::Update().

◆ pressed

bool pressed

Definition at line 126 of file keyboard_unittests.cc.

◆ state_changes_afterwards

std::list<KeyStateChange> state_changes_afterwards

Definition at line 310 of file keyboard_unittests.cc.

◆ text

◆ text_method_call

std::string text_method_call

Definition at line 333 of file keyboard_unittests.cc.

◆ toggled_on

bool toggled_on

Definition at line 127 of file keyboard_unittests.cc.

◆ type