| Flutter Linux Embedder |

Classes | Macros | Functions
fl_keyboard_manager_test.cc File Reference
`#include "flutter/shell/platform/linux/fl_keyboard_manager.h"`
`#include <cstring>`
`#include <vector>`
`#include "flutter/shell/platform/embedder/test_utils/key_codes.g.h"`
`#include "flutter/shell/platform/linux/fl_engine_private.h"`
`#include "flutter/shell/platform/linux/key_mapping.h"`
`#include "flutter/shell/platform/linux/testing/fl_mock_binary_messenger.h"`
`#include "flutter/shell/platform/linux/testing/mock_keymap.h"`
`#include "gtest/gtest.h"`

Go to the source code of this file.

## Classes
struct | CallRecord

## Macros
#define | EXPECT_KEY_EVENT(RECORD, TYPE, PHYSICAL, LOGICAL, CHAR, SYNTHESIZED)
#define | VERIFY_DOWN(OUT_LOGICAL, OUT_CHAR)

## Functions
static CallRecord * | call_record_new (const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *callback_user_data)
static void | call_record_free (CallRecord *record)
static void | call_record_respond (CallRecord *record, bool handled)

## Macro Definition Documentation

## ◆ EXPECT_KEY_EVENT

#define EXPECT_KEY_EVENT | ( |  | RECORD,
|  |  | TYPE,
|  |  | PHYSICAL,
|  |  | LOGICAL,
|  |  | CHAR,
|  |  | SYNTHESIZED
| ) |  |

Value:
EXPECT_EQ((RECORD)->event_type, (TYPE)); \
EXPECT_EQ((RECORD)->event_physical, (PHYSICAL)); \
EXPECT_EQ((RECORD)->event_logical, (LOGICAL)); \
EXPECT_STREQ((RECORD)->event_character, (CHAR)); \
EXPECT_EQ((RECORD)->event_synthesized, (SYNTHESIZED));

Definition at line 21 of file fl_keyboard_manager_test.cc.

## ◆ VERIFY_DOWN

#define VERIFY_DOWN | ( |  | OUT_LOGICAL,
|  |  | OUT_CHAR
| ) |  |

Value:
EXPECT_EQ(static_cast<CallRecord*>(g_ptr_array_index(call_records, 0)) \
->event_type, \
kFlutterKeyEventTypeDown); \
EXPECT_EQ(static_cast<CallRecord*>(g_ptr_array_index(call_records, 0)) \
->event_logical, \
(OUT_LOGICAL)); \
EXPECT_STREQ(static_cast<CallRecord*>(g_ptr_array_index(call_records, 0)) \
->event_character, \
(OUT_CHAR)); \
EXPECT_EQ(static_cast<CallRecord*>(g_ptr_array_index(call_records, 0)) \
->event_synthesized, \
false); \
g_ptr_array_set_size(call_records, 0)
CallRecord
Definition: fl_keyboard_manager_test.cc:43

Definition at line 28 of file fl_keyboard_manager_test.cc.

## Function Documentation

## ◆ call_record_free()

static void call_record_free | ( | CallRecord * | record | ) |
| static

Definition at line 67 of file fl_keyboard_manager_test.cc.

67 {
68 g_free(record->event_character);
69 g_free(record);
70 }
CallRecord::event_character
gchar * event_character
Definition: fl_keyboard_manager_test.cc:47

References CallRecord::event_character.

## ◆ call_record_new()

static CallRecord* call_record_new | ( | const FlutterKeyEvent * | event,
|  | FlutterKeyEventCallback | callback,
|  | void * | callback_user_data
| ) |  |
| static

Definition at line 53 of file fl_keyboard_manager_test.cc.

55 {
56 CallRecord* record = g_new0(CallRecord, 1);
57 record->event_type = event->type;
58 record->event_physical = event->physical;
59 record->event_logical = event->logical;
60 record->event_character = g_strdup(event->character);
61 record->event_synthesized = event->synthesized;
62 record->callback = callback;
63 record->callback_user_data = callback_user_data;
64 return record;
65 }
CallRecord::event_physical
uint64_t event_physical
Definition: fl_keyboard_manager_test.cc:45
CallRecord::event_logical
uint64_t event_logical
Definition: fl_keyboard_manager_test.cc:46
CallRecord::callback
FlutterKeyEventCallback callback
Definition: fl_keyboard_manager_test.cc:49
CallRecord::event_synthesized
bool event_synthesized
Definition: fl_keyboard_manager_test.cc:48
CallRecord::event_type
FlutterKeyEventType event_type
Definition: fl_keyboard_manager_test.cc:44
CallRecord::callback_user_data
void * callback_user_data
Definition: fl_keyboard_manager_test.cc:50

References CallRecord::callback, CallRecord::callback_user_data, CallRecord::event_character, CallRecord::event_logical, CallRecord::event_physical, CallRecord::event_synthesized, and CallRecord::event_type.

## ◆ call_record_respond()

static void call_record_respond | ( | CallRecord * | record,
|  | bool | handled
| ) |  |
| static

Definition at line 72 of file fl_keyboard_manager_test.cc.

72 {
73 if (record->callback != nullptr) {
74 record->callback(handled, record->callback_user_data);
75 }
76 }

References CallRecord::callback, and CallRecord::callback_user_data.