|
Flutter Linux Embedder
|
|
Go to the source code of this file.
|
| TEST (FlEngineTest, WindowMetrics) |
|
| TEST (FlEngineTest, MousePointer) |
|
| TEST (FlEngineTest, PointerPanZoom) |
|
| TEST (FlEngineTest, DispatchSemanticsAction) |
|
| TEST (FlEngineTest, PlatformMessage) |
|
| TEST (FlEngineTest, PlatformMessageResponse) |
|
| TEST (FlEngineTest, SettingsHandler) |
|
void | on_pre_engine_restart_cb (FlEngine *engine, gpointer user_data) |
|
| TEST (FlEngineTest, OnPreEngineRestart) |
|
| TEST (FlEngineTest, DartEntrypointArgs) |
|
| TEST (FlEngineTest, Locales) |
|
| TEST (FlEngineTest, CLocale) |
|
| TEST (FlEngineTest, DuplicateLocale) |
|
| TEST (FlEngineTest, EmptyLocales) |
|
| TEST (FlEngineTest, SwitchesEmpty) |
|
static void | add_view_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
|
| TEST (FlEngineTest, AddView) |
|
static void | add_view_error_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
|
| TEST (FlEngineTest, AddViewError) |
|
static void | add_view_engine_error_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
|
| TEST (FlEngineTest, AddViewEngineError) |
|
static void | remove_view_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
|
| TEST (FlEngineTest, RemoveView) |
|
static void | remove_view_error_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
|
| TEST (FlEngineTest, RemoveViewError) |
|
static void | remove_view_engine_error_cb (GObject *object, GAsyncResult *result, gpointer user_data) |
|
| TEST (FlEngineTest, RemoveViewEngineError) |
|
| TEST (FlEngineTest, Switches) |
|
◆ add_view_cb()
static void add_view_cb |
( |
GObject * |
object, |
|
|
GAsyncResult * |
result, |
|
|
gpointer |
user_data |
|
) |
| |
|
static |
◆ add_view_engine_error_cb()
static void add_view_engine_error_cb |
( |
GObject * |
object, |
|
|
GAsyncResult * |
result, |
|
|
gpointer |
user_data |
|
) |
| |
|
static |
◆ add_view_error_cb()
static void add_view_error_cb |
( |
GObject * |
object, |
|
|
GAsyncResult * |
result, |
|
|
gpointer |
user_data |
|
) |
| |
|
static |
◆ on_pre_engine_restart_cb()
void on_pre_engine_restart_cb |
( |
FlEngine * |
engine, |
|
|
gpointer |
user_data |
|
) |
| |
◆ remove_view_cb()
static void remove_view_cb |
( |
GObject * |
object, |
|
|
GAsyncResult * |
result, |
|
|
gpointer |
user_data |
|
) |
| |
|
static |
◆ remove_view_engine_error_cb()
static void remove_view_engine_error_cb |
( |
GObject * |
object, |
|
|
GAsyncResult * |
result, |
|
|
gpointer |
user_data |
|
) |
| |
|
static |
◆ remove_view_error_cb()
static void remove_view_error_cb |
( |
GObject * |
object, |
|
|
GAsyncResult * |
result, |
|
|
gpointer |
user_data |
|
) |
| |
|
static |
◆ TEST() [1/21]
TEST |
( |
FlEngineTest |
, |
|
|
AddView |
|
|
) |
| |
Definition at line 562 of file fl_engine_test.cc.
563 g_autoptr(GMainLoop) loop = g_main_loop_new(
nullptr, 0);
569 embedder_api->AddView = MOCK_ENGINE_PROC(
570 AddView, ([&called](
auto engine,
const FlutterAddViewInfo* info) {
572 EXPECT_EQ(info->view_metrics->width, 123u);
573 EXPECT_EQ(info->view_metrics->height, 456u);
574 EXPECT_EQ(info->view_metrics->pixel_ratio, 2.0);
576 FlutterAddViewResult
result;
577 result.struct_size =
sizeof(FlutterAddViewResult);
579 result.user_data = info->user_data;
580 info->add_view_callback(&
result);
585 FlutterViewId view_id =
587 EXPECT_GT(view_id, 0);
591 g_main_loop_run(loop);
References add_view_cb(), fl_engine_add_view(), fl_engine_get_embedder_api(), make_mock_engine(), and result.
◆ TEST() [2/21]
TEST |
( |
FlEngineTest |
, |
|
|
AddViewEngineError |
|
|
) |
| |
◆ TEST() [3/21]
TEST |
( |
FlEngineTest |
, |
|
|
AddViewError |
|
|
) |
| |
◆ TEST() [4/21]
TEST |
( |
FlEngineTest |
, |
|
|
CLocale |
|
|
) |
| |
Definition at line 409 of file fl_engine_test.cc.
410 g_autofree gchar* initial_language = g_strdup(g_getenv(
"LANGUAGE"));
411 g_setenv(
"LANGUAGE",
"C",
TRUE);
414 g_autoptr(FlEngine) engine = make_mock_engine_with_project(project);
418 embedder_api->UpdateLocales = MOCK_ENGINE_PROC(
419 UpdateLocales, ([&called](
auto engine,
const FlutterLocale** locales,
420 size_t locales_count) {
423 EXPECT_EQ(locales_count,
static_cast<size_t>(1));
425 EXPECT_STREQ(locales[0]->language_code,
"C");
426 EXPECT_STREQ(locales[0]->country_code,
nullptr);
427 EXPECT_STREQ(locales[0]->script_code,
nullptr);
428 EXPECT_STREQ(locales[0]->variant_code,
nullptr);
433 g_autoptr(GError)
error =
nullptr;
435 EXPECT_EQ(
error,
nullptr);
439 if (initial_language) {
440 g_setenv(
"LANGUAGE", initial_language,
TRUE);
442 g_unsetenv(
"LANGUAGE");
References error, fl_dart_project_new(), fl_engine_get_embedder_api(), fl_engine_start(), and TRUE.
◆ TEST() [5/21]
TEST |
( |
FlEngineTest |
, |
|
|
DartEntrypointArgs |
|
|
) |
| |
Definition at line 322 of file fl_engine_test.cc.
325 GPtrArray* args_array = g_ptr_array_new();
326 g_ptr_array_add(args_array,
const_cast<char*
>(
"arg_one"));
327 g_ptr_array_add(args_array,
const_cast<char*
>(
"arg_two"));
328 g_ptr_array_add(args_array,
const_cast<char*
>(
"arg_three"));
329 g_ptr_array_add(args_array,
nullptr);
330 gchar**
args =
reinterpret_cast<gchar**
>(g_ptr_array_free(args_array,
false));
334 g_autoptr(FlEngine) engine = make_mock_engine_with_project(project);
338 embedder_api->Initialize = MOCK_ENGINE_PROC(
339 Initialize, ([&called, &set_args =
args](
340 size_t version,
const FlutterRendererConfig* config,
342 FLUTTER_API_SYMBOL(FlutterEngine) * engine_out) {
344 EXPECT_NE(set_args,
args->dart_entrypoint_argv);
345 EXPECT_EQ(
args->dart_entrypoint_argc, 3);
350 g_autoptr(GError)
error =
nullptr;
352 EXPECT_EQ(
error,
nullptr);
References args, error, fl_dart_project_new(), fl_dart_project_set_dart_entrypoint_arguments(), fl_engine_get_embedder_api(), fl_engine_start(), and user_data.
◆ TEST() [6/21]
TEST |
( |
FlEngineTest |
, |
|
|
DispatchSemanticsAction |
|
|
) |
| |
Definition at line 120 of file fl_engine_test.cc.
125 embedder_api->DispatchSemanticsAction = MOCK_ENGINE_PROC(
126 DispatchSemanticsAction,
127 ([&called](
auto engine, uint64_t
id, FlutterSemanticsAction action,
128 const uint8_t* data,
size_t data_length) {
129 EXPECT_EQ(
id,
static_cast<uint64_t
>(42));
130 EXPECT_EQ(action, kFlutterSemanticsActionTap);
131 EXPECT_EQ(data_length,
static_cast<size_t>(4));
132 EXPECT_EQ(data[0],
't');
133 EXPECT_EQ(data[1],
'e');
134 EXPECT_EQ(data[2],
's');
135 EXPECT_EQ(data[3],
't');
141 g_autoptr(GError)
error =
nullptr;
143 EXPECT_EQ(
error,
nullptr);
144 g_autoptr(GBytes) data = g_bytes_new_static(
"test", 4);
References error, fl_engine_dispatch_semantics_action(), fl_engine_get_embedder_api(), fl_engine_start(), and make_mock_engine().
◆ TEST() [7/21]
TEST |
( |
FlEngineTest |
, |
|
|
DuplicateLocale |
|
|
) |
| |
Definition at line 446 of file fl_engine_test.cc.
447 g_autofree gchar* initial_language = g_strdup(g_getenv(
"LANGUAGE"));
448 g_setenv(
"LANGUAGE",
"en:en",
TRUE);
451 g_autoptr(FlEngine) engine = make_mock_engine_with_project(project);
455 embedder_api->UpdateLocales = MOCK_ENGINE_PROC(
456 UpdateLocales, ([&called](
auto engine,
const FlutterLocale** locales,
457 size_t locales_count) {
460 EXPECT_EQ(locales_count,
static_cast<size_t>(2));
462 EXPECT_STREQ(locales[0]->language_code,
"en");
463 EXPECT_STREQ(locales[0]->country_code,
nullptr);
464 EXPECT_STREQ(locales[0]->script_code,
nullptr);
465 EXPECT_STREQ(locales[0]->variant_code,
nullptr);
467 EXPECT_STREQ(locales[1]->language_code,
"C");
468 EXPECT_STREQ(locales[1]->country_code,
nullptr);
469 EXPECT_STREQ(locales[1]->script_code,
nullptr);
470 EXPECT_STREQ(locales[1]->variant_code,
nullptr);
475 g_autoptr(GError)
error =
nullptr;
477 EXPECT_EQ(
error,
nullptr);
481 if (initial_language) {
482 g_setenv(
"LANGUAGE", initial_language,
TRUE);
484 g_unsetenv(
"LANGUAGE");
References error, fl_dart_project_new(), fl_engine_get_embedder_api(), fl_engine_start(), and TRUE.
◆ TEST() [8/21]
TEST |
( |
FlEngineTest |
, |
|
|
EmptyLocales |
|
|
) |
| |
Definition at line 488 of file fl_engine_test.cc.
489 g_autofree gchar* initial_language = g_strdup(g_getenv(
"LANGUAGE"));
490 g_setenv(
"LANGUAGE",
"de:: :en_US",
TRUE);
493 g_autoptr(FlEngine) engine = make_mock_engine_with_project(project);
497 embedder_api->UpdateLocales = MOCK_ENGINE_PROC(
498 UpdateLocales, ([&called](
auto engine,
const FlutterLocale** locales,
499 size_t locales_count) {
502 EXPECT_EQ(locales_count,
static_cast<size_t>(4));
504 EXPECT_STREQ(locales[0]->language_code,
"de");
505 EXPECT_STREQ(locales[0]->country_code,
nullptr);
506 EXPECT_STREQ(locales[0]->script_code,
nullptr);
507 EXPECT_STREQ(locales[0]->variant_code,
nullptr);
509 EXPECT_STREQ(locales[1]->language_code,
"en");
510 EXPECT_STREQ(locales[1]->country_code,
"US");
511 EXPECT_STREQ(locales[1]->script_code,
nullptr);
512 EXPECT_STREQ(locales[1]->variant_code,
nullptr);
514 EXPECT_STREQ(locales[2]->language_code,
"en");
515 EXPECT_STREQ(locales[2]->country_code,
nullptr);
516 EXPECT_STREQ(locales[2]->script_code,
nullptr);
517 EXPECT_STREQ(locales[2]->variant_code,
nullptr);
519 EXPECT_STREQ(locales[3]->language_code,
"C");
520 EXPECT_STREQ(locales[3]->country_code,
nullptr);
521 EXPECT_STREQ(locales[3]->script_code,
nullptr);
522 EXPECT_STREQ(locales[3]->variant_code,
nullptr);
527 g_autoptr(GError)
error =
nullptr;
529 EXPECT_EQ(
error,
nullptr);
533 if (initial_language) {
534 g_setenv(
"LANGUAGE", initial_language,
TRUE);
536 g_unsetenv(
"LANGUAGE");
References error, fl_dart_project_new(), fl_engine_get_embedder_api(), fl_engine_start(), and TRUE.
◆ TEST() [9/21]
TEST |
( |
FlEngineTest |
, |
|
|
Locales |
|
|
) |
| |
Definition at line 357 of file fl_engine_test.cc.
358 g_autofree gchar* initial_language = g_strdup(g_getenv(
"LANGUAGE"));
359 g_setenv(
"LANGUAGE",
"de:en_US",
TRUE);
362 g_autoptr(FlEngine) engine = make_mock_engine_with_project(project);
366 embedder_api->UpdateLocales = MOCK_ENGINE_PROC(
367 UpdateLocales, ([&called](
auto engine,
const FlutterLocale** locales,
368 size_t locales_count) {
371 EXPECT_EQ(locales_count,
static_cast<size_t>(4));
373 EXPECT_STREQ(locales[0]->language_code,
"de");
374 EXPECT_STREQ(locales[0]->country_code,
nullptr);
375 EXPECT_STREQ(locales[0]->script_code,
nullptr);
376 EXPECT_STREQ(locales[0]->variant_code,
nullptr);
378 EXPECT_STREQ(locales[1]->language_code,
"en");
379 EXPECT_STREQ(locales[1]->country_code,
"US");
380 EXPECT_STREQ(locales[1]->script_code,
nullptr);
381 EXPECT_STREQ(locales[1]->variant_code,
nullptr);
383 EXPECT_STREQ(locales[2]->language_code,
"en");
384 EXPECT_STREQ(locales[2]->country_code,
nullptr);
385 EXPECT_STREQ(locales[2]->script_code,
nullptr);
386 EXPECT_STREQ(locales[2]->variant_code,
nullptr);
388 EXPECT_STREQ(locales[3]->language_code,
"C");
389 EXPECT_STREQ(locales[3]->country_code,
nullptr);
390 EXPECT_STREQ(locales[3]->script_code,
nullptr);
391 EXPECT_STREQ(locales[3]->variant_code,
nullptr);
396 g_autoptr(GError)
error =
nullptr;
398 EXPECT_EQ(
error,
nullptr);
402 if (initial_language) {
403 g_setenv(
"LANGUAGE", initial_language,
TRUE);
405 g_unsetenv(
"LANGUAGE");
References error, fl_dart_project_new(), fl_engine_get_embedder_api(), fl_engine_start(), and TRUE.
◆ TEST() [10/21]
TEST |
( |
FlEngineTest |
, |
|
|
MousePointer |
|
|
) |
| |
Definition at line 45 of file fl_engine_test.cc.
50 embedder_api->SendPointerEvent = MOCK_ENGINE_PROC(
52 ([&called](
auto engine,
const FlutterPointerEvent* events,
53 size_t events_count) {
55 EXPECT_EQ(events_count,
static_cast<size_t>(1));
56 EXPECT_EQ(events[0].view_id, 1);
57 EXPECT_EQ(events[0].phase, kDown);
58 EXPECT_EQ(events[0].timestamp,
static_cast<size_t>(1234567890));
59 EXPECT_EQ(events[0].x, 800);
60 EXPECT_EQ(events[0].y, 600);
61 EXPECT_EQ(events[0].device,
static_cast<int32_t
>(0));
62 EXPECT_EQ(events[0].signal_kind, kFlutterPointerSignalKindScroll);
63 EXPECT_EQ(events[0].scroll_delta_x, 1.2);
64 EXPECT_EQ(events[0].scroll_delta_y, -3.4);
65 EXPECT_EQ(events[0].device_kind, kFlutterPointerDeviceKindMouse);
66 EXPECT_EQ(events[0].buttons, kFlutterPointerButtonMouseSecondary);
71 g_autoptr(GError)
error =
nullptr;
73 EXPECT_EQ(
error,
nullptr);
75 kFlutterPointerDeviceKindMouse, 1.2, -3.4,
76 kFlutterPointerButtonMouseSecondary);
References error, fl_engine_get_embedder_api(), fl_engine_send_mouse_pointer_event(), fl_engine_start(), and make_mock_engine().
◆ TEST() [11/21]
TEST |
( |
FlEngineTest |
, |
|
|
OnPreEngineRestart |
|
|
) |
| |
Definition at line 279 of file fl_engine_test.cc.
283 OnPreEngineRestartCallback
callback;
284 void* callback_user_data;
287 embedder_api->Initialize = MOCK_ENGINE_PROC(
288 Initialize, ([&
callback, &callback_user_data, &called](
289 size_t version,
const FlutterRendererConfig* config,
291 FLUTTER_API_SYMBOL(FlutterEngine) * engine_out) {
299 g_autoptr(GError)
error =
nullptr;
301 EXPECT_EQ(
error,
nullptr);
315 g_signal_connect(engine,
"on-pre-engine-restart",
References args, callback, error, fl_engine_get_embedder_api(), fl_engine_start(), make_mock_engine(), on_pre_engine_restart_cb(), and user_data.
◆ TEST() [12/21]
TEST |
( |
FlEngineTest |
, |
|
|
PlatformMessage |
|
|
) |
| |
Definition at line 152 of file fl_engine_test.cc.
157 FlutterEngineSendPlatformMessageFnPtr old_handler =
158 embedder_api->SendPlatformMessage;
159 embedder_api->SendPlatformMessage = MOCK_ENGINE_PROC(
161 ([&called, old_handler](
auto engine,
162 const FlutterPlatformMessage* message) {
163 if (strcmp(message->channel,
"test") != 0) {
164 return old_handler(engine, message);
169 EXPECT_EQ(message->message_size,
static_cast<size_t>(4));
170 EXPECT_EQ(message->message[0],
't');
171 EXPECT_EQ(message->message[1],
'e');
172 EXPECT_EQ(message->message[2],
's');
173 EXPECT_EQ(message->message[3],
't');
178 g_autoptr(GError)
error =
nullptr;
180 EXPECT_EQ(
error,
nullptr);
181 g_autoptr(GBytes) message = g_bytes_new_static(
"test", 4);
References error, fl_engine_get_embedder_api(), fl_engine_send_platform_message(), fl_engine_start(), and make_mock_engine().
◆ TEST() [13/21]
TEST |
( |
FlEngineTest |
, |
|
|
PlatformMessageResponse |
|
|
) |
| |
Definition at line 189 of file fl_engine_test.cc.
194 embedder_api->SendPlatformMessageResponse = MOCK_ENGINE_PROC(
195 SendPlatformMessageResponse,
196 ([&called](
auto engine,
197 const FlutterPlatformMessageResponseHandle* handle,
198 const uint8_t* data,
size_t data_length) {
203 reinterpret_cast<const FlutterPlatformMessageResponseHandle*
>(42));
204 EXPECT_EQ(data_length,
static_cast<size_t>(4));
205 EXPECT_EQ(data[0],
't');
206 EXPECT_EQ(data[1],
'e');
207 EXPECT_EQ(data[2],
's');
208 EXPECT_EQ(data[3],
't');
213 g_autoptr(GError)
error =
nullptr;
215 EXPECT_EQ(
error,
nullptr);
216 g_autoptr(GBytes) response = g_bytes_new_static(
"test", 4);
218 engine,
reinterpret_cast<const FlutterPlatformMessageResponseHandle*
>(42),
220 EXPECT_EQ(
error,
nullptr);
References error, fl_engine_get_embedder_api(), fl_engine_send_platform_message_response(), fl_engine_start(), and make_mock_engine().
◆ TEST() [14/21]
TEST |
( |
FlEngineTest |
, |
|
|
PointerPanZoom |
|
|
) |
| |
Definition at line 82 of file fl_engine_test.cc.
87 embedder_api->SendPointerEvent = MOCK_ENGINE_PROC(
89 ([&called](
auto engine,
const FlutterPointerEvent* events,
90 size_t events_count) {
92 EXPECT_EQ(events_count,
static_cast<size_t>(1));
93 EXPECT_EQ(events[0].view_id, 1);
94 EXPECT_EQ(events[0].phase, kPanZoomUpdate);
95 EXPECT_EQ(events[0].timestamp,
static_cast<size_t>(1234567890));
96 EXPECT_EQ(events[0].x, 800);
97 EXPECT_EQ(events[0].y, 600);
98 EXPECT_EQ(events[0].device,
static_cast<int32_t
>(1));
99 EXPECT_EQ(events[0].signal_kind, kFlutterPointerSignalKindNone);
100 EXPECT_EQ(events[0].pan_x, 1.5);
101 EXPECT_EQ(events[0].pan_y, 2.5);
102 EXPECT_EQ(events[0].scale, 3.5);
103 EXPECT_EQ(events[0].rotation, 4.5);
104 EXPECT_EQ(events[0].device_kind, kFlutterPointerDeviceKindTrackpad);
105 EXPECT_EQ(events[0].buttons, 0);
110 g_autoptr(GError)
error =
nullptr;
112 EXPECT_EQ(
error,
nullptr);
114 kPanZoomUpdate, 1.5, 2.5, 3.5, 4.5);
References error, fl_engine_get_embedder_api(), fl_engine_send_pointer_pan_zoom_event(), fl_engine_start(), and make_mock_engine().
◆ TEST() [15/21]
TEST |
( |
FlEngineTest |
, |
|
|
RemoveView |
|
|
) |
| |
◆ TEST() [16/21]
TEST |
( |
FlEngineTest |
, |
|
|
RemoveViewEngineError |
|
|
) |
| |
◆ TEST() [17/21]
TEST |
( |
FlEngineTest |
, |
|
|
RemoveViewError |
|
|
) |
| |
◆ TEST() [18/21]
TEST |
( |
FlEngineTest |
, |
|
|
SettingsHandler |
|
|
) |
| |
Definition at line 226 of file fl_engine_test.cc.
231 embedder_api->SendPlatformMessage = MOCK_ENGINE_PROC(
233 ([&called](
auto engine,
const FlutterPlatformMessage* message) {
236 EXPECT_STREQ(message->channel,
"flutter/settings");
239 g_autoptr(GBytes) data =
240 g_bytes_new(message->message, message->message_size);
241 g_autoptr(GError)
error =
nullptr;
243 FL_MESSAGE_CODEC(codec), data, &
error);
244 EXPECT_NE(settings,
nullptr);
245 EXPECT_EQ(
error,
nullptr);
249 EXPECT_NE(text_scale_factor,
nullptr);
252 FlValue* always_use_24hr_format =
254 EXPECT_NE(always_use_24hr_format,
nullptr);
260 EXPECT_NE(platform_brightness,
nullptr);
266 g_autoptr(GError)
error =
nullptr;
268 EXPECT_EQ(
error,
nullptr);
References error, fl_engine_get_embedder_api(), fl_engine_start(), fl_json_message_codec_new(), fl_message_codec_decode_message(), fl_value_get_type(), fl_value_lookup_string(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_STRING, and make_mock_engine().
◆ TEST() [19/21]
TEST |
( |
FlEngineTest |
, |
|
|
Switches |
|
|
) |
| |
Definition at line 763 of file fl_engine_test.cc.
766 setenv(
"FLUTTER_ENGINE_SWITCHES",
"2", 1);
767 setenv(
"FLUTTER_ENGINE_SWITCH_1",
"abc", 1);
768 setenv(
"FLUTTER_ENGINE_SWITCH_2",
"foo=\"bar, baz\"", 1);
771 EXPECT_EQ(switches->len, 2U);
772 EXPECT_STREQ(
static_cast<const char*
>(g_ptr_array_index(switches, 0)),
774 EXPECT_STREQ(
static_cast<const char*
>(g_ptr_array_index(switches, 1)),
775 "--foo=\"bar, baz\"");
777 unsetenv(
"FLUTTER_ENGINE_SWITCHES");
778 unsetenv(
"FLUTTER_ENGINE_SWITCH_1");
779 unsetenv(
"FLUTTER_ENGINE_SWITCH_2");
References fl_engine_get_switches(), and make_mock_engine().
◆ TEST() [20/21]
TEST |
( |
FlEngineTest |
, |
|
|
SwitchesEmpty |
|
|
) |
| |
◆ TEST() [21/21]
TEST |
( |
FlEngineTest |
, |
|
|
WindowMetrics |
|
|
) |
| |
Definition at line 19 of file fl_engine_test.cc.
24 embedder_api->SendWindowMetricsEvent = MOCK_ENGINE_PROC(
25 SendWindowMetricsEvent,
26 ([&called](
auto engine,
const FlutterWindowMetricsEvent*
event) {
28 EXPECT_EQ(
event->view_id, 1);
29 EXPECT_EQ(
event->width,
static_cast<size_t>(3840));
30 EXPECT_EQ(
event->height,
static_cast<size_t>(2160));
31 EXPECT_EQ(
event->pixel_ratio, 2.0);
36 g_autoptr(GError)
error =
nullptr;
38 EXPECT_EQ(
error,
nullptr);
References error, event, fl_engine_get_embedder_api(), fl_engine_send_window_metrics_event(), fl_engine_start(), and make_mock_engine().
FlutterEngineProcTable * fl_engine_get_embedder_api(FlEngine *self)
static void add_view_engine_error_cb(GObject *object, GAsyncResult *result, gpointer user_data)
typedefG_BEGIN_DECLS struct _FlValue FlValue
G_MODULE_EXPORT FlJsonMessageCodec * fl_json_message_codec_new()
void fl_engine_remove_view(FlEngine *self, FlutterViewId view_id, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback gpointer user_data
void fl_engine_dispatch_semantics_action(FlEngine *self, uint64_t id, FlutterSemanticsAction action, GBytes *data)
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()
G_MODULE_EXPORT FlValue * fl_value_lookup_string(FlValue *self, const gchar *key)
void fl_engine_send_window_metrics_event(FlEngine *self, FlutterViewId view_id, size_t width, size_t height, double pixel_ratio)
static FlEngine * make_mock_engine()
G_MODULE_EXPORT FlValue * fl_message_codec_decode_message(FlMessageCodec *self, GBytes *message, GError **error)
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
gboolean fl_engine_add_view_finish(FlEngine *self, GAsyncResult *result, GError **error)
gboolean fl_engine_remove_view_finish(FlEngine *self, GAsyncResult *result, GError **error)
G_MODULE_EXPORT void fl_dart_project_set_dart_entrypoint_arguments(FlDartProject *self, char **argv)
static void remove_view_engine_error_cb(GObject *object, GAsyncResult *result, gpointer user_data)
FlutterViewId fl_engine_add_view(FlEngine *self, size_t width, size_t height, double pixel_ratio, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
static void add_view_error_cb(GObject *object, GAsyncResult *result, gpointer user_data)
static void add_view_cb(GObject *object, GAsyncResult *result, gpointer user_data)
static void remove_view_cb(GObject *object, GAsyncResult *result, gpointer user_data)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
void fl_engine_send_pointer_pan_zoom_event(FlEngine *self, FlutterViewId view_id, size_t timestamp, double x, double y, FlutterPointerPhase phase, double pan_x, double pan_y, double scale, double rotation)
void fl_engine_send_platform_message(FlEngine *self, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
void on_pre_engine_restart_cb(FlEngine *engine, gpointer user_data)
gboolean fl_engine_start(FlEngine *self, GError **error)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static void remove_view_error_cb(GObject *object, GAsyncResult *result, gpointer user_data)
void fl_engine_send_mouse_pointer_event(FlEngine *self, FlutterViewId view_id, FlutterPointerPhase phase, size_t timestamp, double x, double y, FlutterPointerDeviceKind device_kind, double scroll_delta_x, double scroll_delta_y, int64_t buttons)
GPtrArray * fl_engine_get_switches(FlEngine *self)
gboolean fl_engine_send_platform_message_response(FlEngine *self, const FlutterPlatformMessageResponseHandle *handle, GBytes *response, GError **error)