Flutter Engine
The Flutter Engine
mock_engine.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// This file is a historical legacy, predating the proc table API. It has been
6// updated to continue to work with the proc table, but new tests should not
7// rely on replacements set up here, but instead use test-local replacements
8// for any functions relevant to that test.
9//
10// Over time existing tests should be migrated and this file should be removed.
11
12#include <cstring>
13#include <unordered_map>
14#include <utility>
15
16#include "flutter/shell/platform/embedder/embedder.h"
17#include "flutter/shell/platform/linux/fl_method_codec_private.h"
18#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h"
19#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_response.h"
20#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_method_codec.h"
21#include "gtest/gtest.h"
22
25
28};
29
31 bool running = false;
34 void* user_data;
35 std::unordered_map<int64_t, _FlutterEngineTexture> textures;
36
39 void* user_data)
43};
44
47 void* user_data;
48 std::string channel;
50
51 // Constructor for a response handle generated by the engine.
53 : data_callback(nullptr),
54 user_data(nullptr),
55 channel(std::move(channel)),
56 released(false) {}
57
58 // Constructor for a response handle generated by the shell.
60 void* user_data)
62};
63
65 uint64_t task;
66 std::string channel;
68 uint8_t* message;
70
72 uint64_t task,
73 const std::string& channel,
75 const uint8_t* message,
76 size_t message_size)
77 : task(task),
81 if (message_size > 0) {
82 this->message = static_cast<uint8_t*>(malloc(message_size));
83 memcpy(this->message, message, message_size);
84 } else {
85 this->message = nullptr;
86 }
87 }
89 if (response_handle != nullptr) {
91 delete response_handle;
92 }
93 free(message);
94 }
95};
96
97namespace {
98
99// Send a response from the engine.
100static void send_response(
102 const std::string& channel,
103 const FlutterPlatformMessageResponseHandle* response_handle,
104 const uint8_t* message,
105 size_t message_size) {
106 if (response_handle == nullptr) {
107 return;
108 }
109
110 FlutterTask task;
111 task.runner = new _FlutterTaskRunner(1234, channel, response_handle, message,
112 message_size);
113 task.task = task.runner->task;
114 engine->platform_post_task_callback(task, 0, engine->user_data);
115}
116
117// Send a message from the engine.
118static void send_message(FLUTTER_API_SYMBOL(FlutterEngine) engine,
119 const std::string& channel,
120 const uint8_t* message,
121 size_t message_size) {
122 FlutterTask task;
123 task.runner =
124 new _FlutterTaskRunner(1234, channel, nullptr, message, message_size);
125 task.task = task.runner->task;
126 engine->platform_post_task_callback(task, 0, engine->user_data);
127}
128
129static void invoke_method(FLUTTER_API_SYMBOL(FlutterEngine) engine,
130 const std::string& channel,
131 const gchar* name,
132 FlValue* args) {
133 g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
134 g_autoptr(GError) error = nullptr;
136 FL_METHOD_CODEC(codec), name, args, &error);
137 EXPECT_NE(message, nullptr);
138 EXPECT_EQ(error, nullptr);
139
140 FlutterTask task;
141 task.runner = new _FlutterTaskRunner(
142 1234, channel, nullptr,
143 static_cast<const uint8_t*>(g_bytes_get_data(message, nullptr)),
144 g_bytes_get_size(message));
145 task.task = task.runner->task;
146 engine->platform_post_task_callback(task, 0, engine->user_data);
147}
148
151 FlutterEngineAOTData* data_out) {
152 *data_out = nullptr;
153 return kSuccess;
154}
155
157 return kSuccess;
158}
159
161 const FlutterRendererConfig* config,
163 void* user_data,
165 engine_out) {
166 EXPECT_NE(config, nullptr);
167
168 EXPECT_NE(args, nullptr);
169 EXPECT_NE(args->platform_message_callback, nullptr);
170 EXPECT_NE(args->custom_task_runners, nullptr);
171 EXPECT_NE(args->custom_task_runners->platform_task_runner, nullptr);
172 EXPECT_NE(args->custom_task_runners->platform_task_runner->post_task_callback,
173 nullptr);
174
175 EXPECT_NE(user_data, nullptr);
176
177 EXPECT_EQ(config->type, kOpenGL);
178
179 *engine_out = new _FlutterEngine(
180 args->platform_message_callback,
181 args->custom_task_runners->platform_task_runner->post_task_callback,
182 user_data);
183 return kSuccess;
184}
185
188 engine->running = true;
189 return kSuccess;
190}
191
193 const FlutterRendererConfig* config,
195 void* user_data,
197 engine_out) {
198 EXPECT_NE(config, nullptr);
199 EXPECT_NE(args, nullptr);
200 EXPECT_NE(user_data, nullptr);
201 EXPECT_NE(engine_out, nullptr);
202
204 FlutterEngineInitialize(version, config, args, user_data, engine_out);
205 if (result != kSuccess) {
206 return result;
207 }
208 return FlutterEngineRunInitialized(*engine_out);
209}
210
212 engine) {
213 delete engine;
214 return kSuccess;
215}
216
218 engine) {
219 return kSuccess;
220}
221
226 return kSuccess;
227}
228
231 const FlutterPointerEvent* events,
232 size_t events_count) {
233 return kSuccess;
234}
235
237 engine,
238 const FlutterKeyEvent* event,
240 void* user_data) {
241 return kSuccess;
242}
243
249
250 if (strcmp(message->channel, "test/echo") == 0) {
251 // Responds with the same message received.
252 send_response(engine, message->channel, message->response_handle,
253 message->message, message->message_size);
254 } else if (strcmp(message->channel, "test/send-message") == 0) {
255 // Triggers the engine to send a message.
256 send_response(engine, message->channel, message->response_handle, nullptr,
257 0);
258 send_message(engine, "test/messages", message->message,
259 message->message_size);
260 } else if (strcmp(message->channel, "test/standard-method") == 0) {
261 g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new();
262 g_autoptr(GBytes) m = g_bytes_new(message->message, message->message_size);
263 g_autofree gchar* name = nullptr;
264 g_autoptr(FlValue) args = nullptr;
265 g_autoptr(GError) error = nullptr;
266 EXPECT_TRUE(fl_method_codec_decode_method_call(FL_METHOD_CODEC(codec), m,
267 &name, &args, &error));
268 EXPECT_EQ(error, nullptr);
269
270 g_autoptr(GBytes) response = nullptr;
271 if (strcmp(name, "Echo") == 0) {
272 // Returns args as a success result.
273 response = fl_method_codec_encode_success_envelope(FL_METHOD_CODEC(codec),
274 args, &error);
275 EXPECT_EQ(error, nullptr);
276 } else if (strcmp(name, "Error") == 0) {
277 // Returns an error result.
278 const gchar* code = nullptr;
279 const gchar* message = nullptr;
280 FlValue* details = nullptr;
281 if (fl_value_get_length(args) >= 2) {
282 FlValue* code_value = fl_value_get_list_value(args, 0);
283 EXPECT_EQ(fl_value_get_type(code_value), FL_VALUE_TYPE_STRING);
284 code = fl_value_get_string(code_value);
285 FlValue* message_value = fl_value_get_list_value(args, 1);
287 ? fl_value_get_string(message_value)
288 : nullptr;
289 }
290 if (fl_value_get_length(args) >= 3) {
291 details = fl_value_get_list_value(args, 2);
292 }
294 FL_METHOD_CODEC(codec), code, message, details, &error);
295 EXPECT_EQ(error, nullptr);
296 } else if (strcmp(name, "InvokeMethod") == 0) {
297 // Gets the engine to call the shell.
298 if (fl_value_get_length(args) == 3) {
299 FlValue* channel_value = fl_value_get_list_value(args, 0);
300 EXPECT_EQ(fl_value_get_type(channel_value), FL_VALUE_TYPE_STRING);
301 const gchar* channel = fl_value_get_string(channel_value);
302 FlValue* name_value = fl_value_get_list_value(args, 1);
303 EXPECT_EQ(fl_value_get_type(name_value), FL_VALUE_TYPE_STRING);
304 const gchar* name = fl_value_get_string(name_value);
305 FlValue* method_args = fl_value_get_list_value(args, 2);
306 invoke_method(engine, channel, name, method_args);
307 }
308 response = fl_method_codec_encode_success_envelope(FL_METHOD_CODEC(codec),
309 nullptr, &error);
310 EXPECT_EQ(error, nullptr);
311 } else {
312 // Returns "not implemented".
313 response = g_bytes_new(nullptr, 0);
314 }
315
317 engine, message->channel, message->response_handle,
318 static_cast<const uint8_t*>(g_bytes_get_data(response, nullptr)),
319 g_bytes_get_size(response));
320 } else if (strcmp(message->channel, "test/nullptr-response") == 0) {
321 // Sends a null response.
322 send_response(engine, message->channel, message->response_handle, nullptr,
323 0);
324 } else if (strcmp(message->channel, "test/standard-event") == 0) {
325 // Send a message so the shell can check the events sent.
326 send_message(engine, "test/events", message->message,
327 message->message_size);
328 } else if (strcmp(message->channel, "test/failure") == 0) {
329 // Generates an internal error.
331 } else if (strcmp(message->channel, "test/key-event-handled") == 0 ||
332 strcmp(message->channel, "test/key-event-not-handled") == 0) {
333 bool value = strcmp(message->channel, "test/key-event-handled") == 0;
334 g_autoptr(FlJsonMessageCodec) codec = fl_json_message_codec_new();
335 g_autoptr(FlValue) handledValue = fl_value_new_map();
336 fl_value_set_string_take(handledValue, "handled", fl_value_new_bool(value));
337 g_autoptr(GBytes) response = fl_message_codec_encode_message(
338 FL_MESSAGE_CODEC(codec), handledValue, nullptr);
340 engine, message->channel, message->response_handle,
341 static_cast<const uint8_t*>(g_bytes_get_data(response, nullptr)),
342 g_bytes_get_size(response));
343 } else if (strcmp(message->channel, "test/key-event-delayed") == 0) {
344 static std::unique_ptr<const FlutterPlatformMessageResponseHandle>
345 delayed_response_handle = nullptr;
346 g_autoptr(FlJsonMessageCodec) codec = fl_json_message_codec_new();
347 g_autoptr(FlValue) handledValue = fl_value_new_map();
348 fl_value_set_string_take(handledValue, "handled", fl_value_new_bool(true));
349 g_autoptr(GBytes) response = fl_message_codec_encode_message(
350 FL_MESSAGE_CODEC(codec), handledValue, nullptr);
351 if (delayed_response_handle == nullptr) {
352 delayed_response_handle.reset(message->response_handle);
353 } else {
355 engine, message->channel, message->response_handle,
356 static_cast<const uint8_t*>(g_bytes_get_data(response, nullptr)),
357 g_bytes_get_size(response));
359 engine, message->channel, delayed_response_handle.release(),
360 static_cast<const uint8_t*>(g_bytes_get_data(response, nullptr)),
361 g_bytes_get_size(response));
362 }
363 }
364
365 return kSuccess;
366}
367
370 FlutterDataCallback data_callback,
371 void* user_data,
374 EXPECT_NE(data_callback, nullptr);
375 EXPECT_NE(user_data, nullptr);
376
379
380 *response_out = handle;
381 return kSuccess;
382}
383
387 EXPECT_NE(engine, nullptr);
388 EXPECT_NE(response, nullptr);
389
391
392 EXPECT_FALSE(response->released);
393 response->released = true;
394
395 return kSuccess;
396}
397
401 const uint8_t* data,
402 size_t data_length) {
403 EXPECT_NE(engine, nullptr);
404 EXPECT_NE(handle, nullptr);
405
407
408 // Send a message so the shell can check the responses received.
409 if (handle->channel != "test/responses") {
410 send_message(engine, "test/responses", data, data_length);
411 }
412
413 EXPECT_FALSE(handle->released);
414
415 delete handle;
416
417 return kSuccess;
418}
419
421 engine,
422 const FlutterTask* task) {
423 EXPECT_NE(engine, nullptr);
424 EXPECT_NE(task, nullptr);
425 EXPECT_NE(task->runner, nullptr);
426
427 FlutterTaskRunner runner = task->runner;
428 EXPECT_NE(runner, nullptr);
429 const FlutterPlatformMessageResponseHandle* response_handle =
430 runner->response_handle;
431 if (response_handle != nullptr) {
432 EXPECT_NE(response_handle->data_callback, nullptr);
433 response_handle->data_callback(runner->message, runner->message_size,
434 response_handle->user_data);
435 } else {
438
440 message.struct_size = sizeof(FlutterPlatformMessage);
441 message.channel = runner->channel.c_str();
442 message.message = runner->message;
443 message.message_size = runner->message_size;
444 message.response_handle = handle;
445 engine->platform_message_callback(&message, engine->user_data);
446 }
447
448 delete runner;
449
450 return kSuccess;
451}
452
454 return false;
455}
456
458 engine,
459 const FlutterLocale** locales,
460 size_t locales_count) {
461 return kSuccess;
462}
463
466 bool enabled) {
467 return kSuccess;
468}
469
473 return kSuccess;
474}
475
478 uint64_t id,
480 const uint8_t* data,
481 size_t data_length) {
482 return kSuccess;
483}
484
487 int64_t texture_identifier) {
489 texture.has_new_frame = false;
490 engine->textures[texture_identifier] = texture;
491 return kSuccess;
492}
493
496 int64_t texture_identifier) {
497 auto val = engine->textures.find(texture_identifier);
498 if (val == std::end(engine->textures)) {
499 return kInvalidArguments;
500 }
501 val->second.has_new_frame = true;
502 return kSuccess;
503}
504
507 int64_t texture_identifier) {
508 auto val = engine->textures.find(texture_identifier);
509 if (val == std::end(engine->textures)) {
510 return kInvalidArguments;
511 }
512 engine->textures.erase(texture_identifier);
513 return kSuccess;
514}
515
519 const FlutterEngineDisplay* displays,
520 size_t display_count) {
521 return kSuccess;
522}
523
524} // namespace
525
528 if (!table) {
529 return kInvalidArguments;
530 }
531
532 FlutterEngineProcTable empty_table = {};
533 *table = empty_table;
534
535 table->CreateAOTData = &FlutterEngineCreateAOTData;
536 table->CollectAOTData = &FlutterEngineCollectAOTData;
537 table->Run = &FlutterEngineRun;
538 table->Shutdown = &FlutterEngineShutdown;
539 table->Initialize = &FlutterEngineInitialize;
540 table->Deinitialize = &FlutterEngineDeinitialize;
541 table->RunInitialized = &FlutterEngineRunInitialized;
542 table->SendWindowMetricsEvent = &FlutterEngineSendWindowMetricsEvent;
543 table->SendPointerEvent = &FlutterEngineSendPointerEvent;
544 table->SendKeyEvent = &FlutterEngineSendKeyEvent;
545 table->SendPlatformMessage = &FlutterEngineSendPlatformMessage;
546 table->PlatformMessageCreateResponseHandle =
548 table->PlatformMessageReleaseResponseHandle =
550 table->SendPlatformMessageResponse =
552 table->RunTask = &FlutterEngineRunTask;
553 table->UpdateLocales = &FlutterEngineUpdateLocales;
554 table->UpdateSemanticsEnabled = &FlutterEngineUpdateSemanticsEnabled;
555 table->DispatchSemanticsAction = &FlutterEngineDispatchSemanticsAction;
556 table->RunsAOTCompiledDartCode = &FlutterEngineRunsAOTCompiledDartCode;
557 table->RegisterExternalTexture = &FlutterEngineRegisterExternalTexture;
558 table->MarkExternalTextureFrameAvailable =
560 table->UnregisterExternalTexture = &FlutterEngineUnregisterExternalTexture;
561 table->UpdateAccessibilityFeatures =
563 table->NotifyDisplayUpdate = &FlutterEngineNotifyDisplayUpdate;
564 return kSuccess;
565}
SI F table(const skcms_Curve *curve, F v)
FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Mark that a new texture frame is available for a given texture identifier.
Definition: embedder.cc:2809
FlutterEngineResult FlutterEngineRunTask(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
Inform the engine to run the specified task. This task has been given to the engine via the FlutterTa...
Definition: embedder.cc:2959
FlutterEngineResult FlutterEngineRun(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method ...
Definition: embedder.cc:1715
FlutterEngineResult FlutterEngineRegisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Register an external texture with a unique (per engine) identifier. Only rendering backends that supp...
Definition: embedder.cc:2769
FlutterEngineResult FlutterEngineUpdateLocales(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
Notify a running engine instance that the locale has been updated. The preferred locale must be the f...
Definition: embedder.cc:3004
FlutterEngineResult FlutterEngineSendWindowMetricsEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *flutter_metrics)
Definition: embedder.cc:2320
FlutterEngineResult FlutterEngineDispatchSemanticsAction(FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t node_id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
Dispatch a semantics action to the specified semantics node.
Definition: embedder.cc:2855
FLUTTER_EXPORT FlutterEngineResult FlutterEngineDeinitialize(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Stops running the Flutter engine instance. After this call, the embedder is also guaranteed that no m...
Definition: embedder.cc:2297
FlutterEngineResult FlutterEngineInitialize(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize a Flutter engine instance. This does not run the Flutter application code till the Flutter...
Definition: embedder.cc:1731
FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature flags)
Sets additional accessibility features.
Definition: embedder.cc:2841
FlutterEngineResult FlutterEngineShutdown(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Shuts down a Flutter engine instance. The engine handle is no longer valid for any calls in the embed...
Definition: embedder.cc:2309
FlutterEngineResult FlutterPlatformMessageCreateResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
Creates a platform message response handle that allows the embedder to set a native callback for a re...
Definition: embedder.cc:2687
FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data)
Collects the AOT data.
Definition: embedder.cc:1480
FlutterEngineResult FlutterEngineNotifyDisplayUpdate(FLUTTER_API_SYMBOL(FlutterEngine) raw_engine, const FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *embedder_displays, size_t display_count)
Posts updates corresponding to display changes to a running engine instance.
Definition: embedder.cc:3252
FlutterEngineResult FlutterEngineSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *flutter_message)
Definition: embedder.cc:2636
bool FlutterEngineRunsAOTCompiledDartCode(void)
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading re...
Definition: embedder.cc:3063
FlutterEngineResult FlutterEngineSendPointerEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *pointers, size_t events_count)
Definition: embedder.cc:2429
FlutterEngineResult FlutterEngineRunInitialized(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize....
Definition: embedder.cc:2154
FlutterEngineResult FlutterEngineUnregisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Unregister a previous texture registration.
Definition: embedder.cc:2788
FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Enable or disable accessibility semantics.
Definition: embedder.cc:2827
FlutterEngineResult FlutterEngineSendKeyEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Sends a key event to the engine. The framework will decide whether to handle this event in a synchron...
Definition: embedder.cc:2581
FlutterEngineResult FlutterEngineSendPlatformMessageResponse(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Send a response from the native side to a platform message from the Dart Flutter application.
Definition: embedder.cc:2737
FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
Definition: embedder.cc:2722
FlutterEngineResult FlutterEngineCreateAOTData(const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
Creates the necessary data structures to launch a Flutter Dart application in AOT mode....
Definition: embedder.cc:1426
void(* FlutterPlatformMessageCallback)(const FlutterPlatformMessage *, void *)
Definition: embedder.h:1177
@ kOpenGL
Definition: embedder.h:80
struct _FlutterEngine * FLUTTER_API_SYMBOL(FlutterEngine)
Definition: embedder.h:269
void(* FlutterDataCallback)(const uint8_t *, size_t, void *)
Definition: embedder.h:1181
FlutterAccessibilityFeature
Definition: embedder.h:91
void(* FlutterTaskRunnerPostTaskCallback)(FlutterTask, uint64_t, void *)
Definition: embedder.h:1555
FlutterEngineResult
Definition: embedder.h:72
@ kInternalInconsistency
Definition: embedder.h:76
@ kInvalidArguments
Definition: embedder.h:75
@ kSuccess
Definition: embedder.h:73
FlutterEngineDisplaysUpdateType
Definition: embedder.h:2000
FlutterSemanticsAction
Definition: embedder.h:113
void(* FlutterKeyEventCallback)(bool, void *)
Definition: embedder.h:1155
FlutterEngine engine
Definition: main.cc:68
SkBitmap source
Definition: examples.cpp:28
static gboolean send_response(FlBinaryMessenger *messenger, FlBinaryMessengerResponseHandle *response_handle_, GBytes *response, GError **error)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_MODULE_EXPORT FlJsonMessageCodec * fl_json_message_codec_new()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
FlKeyEvent * event
G_MODULE_EXPORT GBytes * fl_message_codec_encode_message(FlMessageCodec *self, FlValue *message, GError **error)
gboolean fl_method_codec_decode_method_call(FlMethodCodec *self, GBytes *message, gchar **name, FlValue **args, GError **error)
GBytes * fl_method_codec_encode_success_envelope(FlMethodCodec *self, FlValue *result, GError **error)
GBytes * fl_method_codec_encode_method_call(FlMethodCodec *self, const gchar *name, FlValue *args, GError **error)
GBytes * fl_method_codec_encode_error_envelope(FlMethodCodec *self, const gchar *code, const gchar *message, FlValue *details, GError **error)
const uint8_t uint32_t uint32_t GError ** error
uint8_t value
G_MODULE_EXPORT FlStandardMethodCodec * fl_standard_method_codec_new()
GAsyncResult * result
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:366
G_MODULE_EXPORT void fl_value_set_string_take(FlValue *self, const gchar *key, FlValue *value)
Definition: fl_value.cc:650
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:466
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:255
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:682
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:776
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:724
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
@ FL_VALUE_TYPE_STRING
Definition: fl_value.h:69
#define FLUTTER_EXPORT
Win32Message message
const int32_t kFlutterSemanticsNodeIdBatchEnd
Definition: mock_engine.cc:23
const int32_t kFlutterSemanticsCustomActionIdBatchEnd
Definition: mock_engine.cc:24
FlutterEngineResult FlutterEngineGetProcAddresses(FlutterEngineProcTable *table)
Gets the table of engine function pointers.
Definition: mock_engine.cc:526
FlTexture * texture
void * malloc(size_t size)
Definition: allocation.cc:19
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
Definition: ref_ptr.h:256
Function-pointer-based versions of the APIs above.
Definition: embedder.h:3319
FlutterRendererType type
Definition: embedder.h:827
FlutterTaskRunner runner
Definition: embedder.h:1551
uint64_t task
Definition: embedder.h:1552
FlutterTaskRunnerPostTaskCallback platform_post_task_callback
Definition: mock_engine.cc:33
_FlutterEngine(FlutterPlatformMessageCallback platform_message_callback, FlutterTaskRunnerPostTaskCallback platform_post_task_callback, void *user_data)
Definition: mock_engine.cc:37
FlutterPlatformMessageCallback platform_message_callback
Definition: mock_engine.cc:32
void * user_data
Definition: mock_engine.cc:34
std::unordered_map< int64_t, _FlutterEngineTexture > textures
Definition: mock_engine.cc:35
_FlutterPlatformMessageResponseHandle(std::string channel)
Definition: mock_engine.cc:52
_FlutterPlatformMessageResponseHandle(FlutterDataCallback data_callback, void *user_data)
Definition: mock_engine.cc:59
_FlutterTaskRunner(uint64_t task, const std::string &channel, const FlutterPlatformMessageResponseHandle *response_handle, const uint8_t *message, size_t message_size)
Definition: mock_engine.cc:71
std::string channel
Definition: mock_engine.cc:66
const FlutterPlatformMessageResponseHandle * response_handle
Definition: mock_engine.cc:67
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63
void * user_data
#define EXPECT_TRUE(handle)
Definition: unit_test.h:678