Flutter Engine
 
Loading...
Searching...
No Matches
engine_unittests.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
6
7#include <cstring>
8
13#include "fml/mapping.h"
14#include "gmock/gmock.h"
16#include "rapidjson/document.h"
17#include "rapidjson/stringbuffer.h"
18#include "rapidjson/writer.h"
21
22namespace flutter {
23
24namespace {
25
26class FontManifestAssetResolver : public AssetResolver {
27 public:
28 FontManifestAssetResolver() {}
29
30 bool IsValid() const override { return true; }
31
32 bool IsValidAfterAssetManagerChange() const override { return true; }
33
34 AssetResolver::AssetResolverType GetType() const override {
36 }
37
38 mutable size_t mapping_call_count = 0u;
39 std::unique_ptr<fml::Mapping> GetAsMapping(
40 const std::string& asset_name) const override {
42 if (asset_name == "FontManifest.json") {
43 return std::make_unique<fml::DataMapping>("[{},{},{}]");
44 }
45 return nullptr;
46 }
47
48 std::vector<std::unique_ptr<fml::Mapping>> GetAsMappings(
49 const std::string& asset_pattern,
50 const std::optional<std::string>& subdir) const override {
51 return {};
52 };
53
54 bool operator==(const AssetResolver& other) const override {
55 auto mapping = GetAsMapping("FontManifest.json");
56 return memcmp(other.GetAsMapping("FontManifest.json")->GetMapping(),
57 mapping->GetMapping(), mapping->GetSize()) == 0;
58 }
59};
60
61class MockDelegate : public Engine::Delegate {
62 public:
63 MOCK_METHOD(void,
64 OnEngineUpdateSemantics,
66 (override));
67 MOCK_METHOD(void,
68 OnEngineSetApplicationLocale,
69 (const std::string),
70 (override));
71 MOCK_METHOD(void, OnEngineSetSemanticsTreeEnabled, (bool), (override));
72 MOCK_METHOD(void,
73 OnEngineHandlePlatformMessage,
74 (std::unique_ptr<PlatformMessage>),
75 (override));
76 MOCK_METHOD(void, OnPreEngineRestart, (), (override));
77 MOCK_METHOD(void, OnRootIsolateCreated, (), (override));
78 MOCK_METHOD(void,
79 UpdateIsolateDescription,
80 (const std::string, int64_t),
81 (override));
82 MOCK_METHOD(void, SetNeedsReportTimings, (bool), (override));
83 MOCK_METHOD(std::unique_ptr<std::vector<std::string>>,
84 ComputePlatformResolvedLocale,
85 (const std::vector<std::string>&),
86 (override));
87 MOCK_METHOD(void, RequestDartDeferredLibrary, (intptr_t), (override));
88 MOCK_METHOD(fml::TimePoint, GetCurrentTimePoint, (), (override));
89 MOCK_METHOD(const std::shared_ptr<PlatformMessageHandler>&,
90 GetPlatformMessageHandler,
91 (),
92 (const, override));
93 MOCK_METHOD(void, OnEngineChannelUpdate, (std::string, bool), (override));
94 MOCK_METHOD(double,
95 GetScaledFontSize,
96 (double font_size, int configuration_id),
97 (const, override));
98 MOCK_METHOD(void,
99 RequestViewFocusChange,
100 (const ViewFocusChangeRequest&),
101 (override));
102};
103
104class MockResponse : public PlatformMessageResponse {
105 public:
106 MOCK_METHOD(void, Complete, (std::unique_ptr<fml::Mapping> data), (override));
107 MOCK_METHOD(void, CompleteEmpty, (), (override));
108};
109
110class MockRuntimeDelegate : public RuntimeDelegate {
111 public:
112 MOCK_METHOD(std::string, DefaultRouteName, (), (override));
113 MOCK_METHOD(void, ScheduleFrame, (bool), (override));
114 MOCK_METHOD(void, OnAllViewsRendered, (), (override));
115 MOCK_METHOD(void,
116 Render,
117 (int64_t, std::unique_ptr<flutter::LayerTree>, float),
118 (override));
119 MOCK_METHOD(void,
120 UpdateSemantics,
122 (override));
123 MOCK_METHOD(void, SetApplicationLocale, (const std::string), (override));
124 MOCK_METHOD(void, SetSemanticsTreeEnabled, (bool), (override));
125 MOCK_METHOD(void,
126 HandlePlatformMessage,
127 (std::unique_ptr<PlatformMessage>),
128 (override));
129 MOCK_METHOD(FontCollection&, GetFontCollection, (), (override));
130 MOCK_METHOD(std::shared_ptr<AssetManager>, GetAssetManager, (), (override));
131 MOCK_METHOD(void, OnRootIsolateCreated, (), (override));
132 MOCK_METHOD(void,
133 UpdateIsolateDescription,
134 (const std::string, int64_t),
135 (override));
136 MOCK_METHOD(void, SetNeedsReportTimings, (bool), (override));
137 MOCK_METHOD(std::unique_ptr<std::vector<std::string>>,
138 ComputePlatformResolvedLocale,
139 (const std::vector<std::string>&),
140 (override));
141 MOCK_METHOD(void, RequestDartDeferredLibrary, (intptr_t), (override));
142 MOCK_METHOD(std::weak_ptr<PlatformMessageHandler>,
143 GetPlatformMessageHandler,
144 (),
145 (const, override));
146 MOCK_METHOD(void, SendChannelUpdate, (std::string, bool), (override));
147 MOCK_METHOD(double,
148 GetScaledFontSize,
149 (double font_size, int configuration_id),
150 (const, override));
151 MOCK_METHOD(void,
152 RequestViewFocusChange,
153 (const ViewFocusChangeRequest&),
154 (override));
155};
156
157class MockRuntimeController : public RuntimeController {
158 public:
159 MockRuntimeController(RuntimeDelegate& client,
160 const TaskRunners& p_task_runners)
161 : RuntimeController(client, p_task_runners) {}
162 MOCK_METHOD(bool, IsRootIsolateRunning, (), (override, const));
163 MOCK_METHOD(bool,
165 (std::unique_ptr<PlatformMessage>),
166 (override));
167 MOCK_METHOD(void,
168 LoadDartDeferredLibraryError,
169 (intptr_t, const std::string, bool),
170 (override));
171 MOCK_METHOD(DartVM*, GetDartVM, (), (const, override));
172 MOCK_METHOD(bool, NotifyIdle, (fml::TimeDelta), (override));
173};
174
175class MockFontCollection : public FontCollection {
176 public:
177 MOCK_METHOD(void,
178 RegisterFonts,
179 (const std::shared_ptr<AssetManager>& asset_manager),
180 (override));
181};
182
183std::unique_ptr<PlatformMessage> MakePlatformMessage(
184 const std::string& channel,
185 const std::map<std::string, std::string>& values,
186 const fml::RefPtr<PlatformMessageResponse>& response) {
187 rapidjson::Document document;
188 auto& allocator = document.GetAllocator();
189 document.SetObject();
190
191 for (const auto& pair : values) {
192 rapidjson::Value key(pair.first.c_str(), strlen(pair.first.c_str()),
193 allocator);
194 rapidjson::Value value(pair.second.c_str(), strlen(pair.second.c_str()),
195 allocator);
196 document.AddMember(key, value, allocator);
197 }
198
199 rapidjson::StringBuffer buffer;
200 rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
201 document.Accept(writer);
202 const uint8_t* data = reinterpret_cast<const uint8_t*>(buffer.GetString());
203
204 std::unique_ptr<PlatformMessage> message = std::make_unique<PlatformMessage>(
205 channel, fml::MallocMapping::Copy(data, buffer.GetSize()), response);
206 return message;
207}
208
209class EngineTest : public testing::FixtureTest {
210 public:
211 EngineTest()
212 : thread_host_("EngineTest",
213 ThreadHost::Type::kPlatform | ThreadHost::Type::kIo |
214 ThreadHost::Type::kUi | ThreadHost::Type::kRaster),
216 "EngineTest",
217 thread_host_.platform_thread->GetTaskRunner(), // platform
218 thread_host_.raster_thread->GetTaskRunner(), // raster
219 thread_host_.ui_thread->GetTaskRunner(), // ui
220 thread_host_.io_thread->GetTaskRunner() // io
221 }) {}
222
223 void PostUITaskSync(const std::function<void()>& function) {
225 task_runners_.GetUITaskRunner()->PostTask([&] {
226 function();
227 latch.Signal();
228 });
229 latch.Wait();
230 }
231
232 protected:
233 void SetUp() override {
234 settings_ = CreateSettingsForFixture();
235 dispatcher_maker_ = [](PointerDataDispatcher::Delegate&) {
236 return nullptr;
237 };
238 }
239
240 MockDelegate delegate_;
242 ThreadHost thread_host_;
243 TaskRunners task_runners_;
244 Settings settings_;
245 std::unique_ptr<Animator> animator_;
247 std::unique_ptr<RuntimeController> runtime_controller_;
248 std::shared_ptr<fml::ConcurrentTaskRunner> image_decoder_task_runner_;
250};
251} // namespace
252
253TEST_F(EngineTest, Create) {
254 PostUITaskSync([this] {
255 auto engine = std::make_unique<Engine>(
256 /*delegate=*/delegate_,
257 /*dispatcher_maker=*/dispatcher_maker_,
258 /*image_decoder_task_runner=*/image_decoder_task_runner_,
259 /*task_runners=*/task_runners_,
260 /*settings=*/settings_,
261 /*animator=*/std::move(animator_),
262 /*io_manager=*/io_manager_,
263 /*font_collection=*/std::make_shared<FontCollection>(),
264 /*runtime_controller=*/std::move(runtime_controller_),
265 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
266 EXPECT_TRUE(engine);
267 });
268}
269
270TEST_F(EngineTest, DispatchPlatformMessageUnknown) {
271 PostUITaskSync([this] {
272 MockRuntimeDelegate client;
273 auto mock_runtime_controller =
274 std::make_unique<MockRuntimeController>(client, task_runners_);
275 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
276 .WillRepeatedly(::testing::Return(false));
277 auto engine = std::make_unique<Engine>(
278 /*delegate=*/delegate_,
279 /*dispatcher_maker=*/dispatcher_maker_,
280 /*image_decoder_task_runner=*/image_decoder_task_runner_,
281 /*task_runners=*/task_runners_,
282 /*settings=*/settings_,
283 /*animator=*/std::move(animator_),
284 /*io_manager=*/io_manager_,
285 /*font_collection=*/std::make_shared<FontCollection>(),
286 /*runtime_controller=*/std::move(mock_runtime_controller),
287 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
288
290 fml::MakeRefCounted<MockResponse>();
291 std::unique_ptr<PlatformMessage> message =
292 std::make_unique<PlatformMessage>("foo", response);
293 engine->DispatchPlatformMessage(std::move(message));
294 });
295}
296
297TEST_F(EngineTest, DispatchPlatformMessageInitialRoute) {
298 PostUITaskSync([this] {
299 MockRuntimeDelegate client;
300 auto mock_runtime_controller =
301 std::make_unique<MockRuntimeController>(client, task_runners_);
302 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
303 .WillRepeatedly(::testing::Return(false));
304 auto engine = std::make_unique<Engine>(
305 /*delegate=*/delegate_,
306 /*dispatcher_maker=*/dispatcher_maker_,
307 /*image_decoder_task_runner=*/image_decoder_task_runner_,
308 /*task_runners=*/task_runners_,
309 /*settings=*/settings_,
310 /*animator=*/std::move(animator_),
311 /*io_manager=*/io_manager_,
312 /*font_collection=*/std::make_shared<FontCollection>(),
313 /*runtime_controller=*/std::move(mock_runtime_controller),
314 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
315
317 fml::MakeRefCounted<MockResponse>();
318 std::map<std::string, std::string> values{
319 {"method", "setInitialRoute"},
320 {"args", "test_initial_route"},
321 };
322 std::unique_ptr<PlatformMessage> message =
323 MakePlatformMessage("flutter/navigation", values, response);
324 engine->DispatchPlatformMessage(std::move(message));
325 EXPECT_EQ(engine->InitialRoute(), "test_initial_route");
326 });
327}
328
329TEST_F(EngineTest, DispatchPlatformMessageInitialRouteIgnored) {
330 PostUITaskSync([this] {
331 MockRuntimeDelegate client;
332 auto mock_runtime_controller =
333 std::make_unique<MockRuntimeController>(client, task_runners_);
334 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
335 .WillRepeatedly(::testing::Return(true));
336 EXPECT_CALL(*mock_runtime_controller, DispatchPlatformMessage(::testing::_))
337 .WillRepeatedly(::testing::Return(true));
338 auto engine = std::make_unique<Engine>(
339 /*delegate=*/delegate_,
340 /*dispatcher_maker=*/dispatcher_maker_,
341 /*image_decoder_task_runner=*/image_decoder_task_runner_,
342 /*task_runners=*/task_runners_,
343 /*settings=*/settings_,
344 /*animator=*/std::move(animator_),
345 /*io_manager=*/io_manager_,
346 /*font_collection=*/std::make_shared<FontCollection>(),
347 /*runtime_controller=*/std::move(mock_runtime_controller),
348 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
349
351 fml::MakeRefCounted<MockResponse>();
352 std::map<std::string, std::string> values{
353 {"method", "setInitialRoute"},
354 {"args", "test_initial_route"},
355 };
356 std::unique_ptr<PlatformMessage> message =
357 MakePlatformMessage("flutter/navigation", values, response);
358 engine->DispatchPlatformMessage(std::move(message));
359 EXPECT_EQ(engine->InitialRoute(), "");
360 });
361}
362
363TEST_F(EngineTest, SpawnSharesFontLibrary) {
364 PostUITaskSync([this] {
365 MockRuntimeDelegate client;
366 auto mock_runtime_controller =
367 std::make_unique<MockRuntimeController>(client, task_runners_);
368 auto vm_ref = DartVMRef::Create(settings_);
369 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
370 .WillRepeatedly(::testing::Return(vm_ref.get()));
371 auto engine = std::make_unique<Engine>(
372 /*delegate=*/delegate_,
373 /*dispatcher_maker=*/dispatcher_maker_,
374 /*image_decoder_task_runner=*/image_decoder_task_runner_,
375 /*task_runners=*/task_runners_,
376 /*settings=*/settings_,
377 /*animator=*/std::move(animator_),
378 /*io_manager=*/io_manager_,
379 /*font_collection=*/std::make_shared<FontCollection>(),
380 /*runtime_controller=*/std::move(mock_runtime_controller),
381 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
382
383 auto spawn =
385 std::string(), io_manager_, snapshot_delegate_, nullptr);
386 EXPECT_TRUE(spawn != nullptr);
387 EXPECT_EQ(&engine->GetFontCollection(), &spawn->GetFontCollection());
388 });
389}
390
391TEST_F(EngineTest, SpawnWithCustomInitialRoute) {
392 PostUITaskSync([this] {
393 MockRuntimeDelegate client;
394 auto mock_runtime_controller =
395 std::make_unique<MockRuntimeController>(client, task_runners_);
396 auto vm_ref = DartVMRef::Create(settings_);
397 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
398 .WillRepeatedly(::testing::Return(vm_ref.get()));
399 auto engine = std::make_unique<Engine>(
400 /*delegate=*/delegate_,
401 /*dispatcher_maker=*/dispatcher_maker_,
402 /*image_decoder_task_runner=*/image_decoder_task_runner_,
403 /*task_runners=*/task_runners_,
404 /*settings=*/settings_,
405 /*animator=*/std::move(animator_),
406 /*io_manager=*/io_manager_,
407 /*font_collection=*/std::make_shared<FontCollection>(),
408 /*runtime_controller=*/std::move(mock_runtime_controller),
409 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
410
411 auto spawn =
412 engine->Spawn(delegate_, dispatcher_maker_, settings_, nullptr, "/foo",
414 EXPECT_TRUE(spawn != nullptr);
415 ASSERT_EQ("/foo", spawn->InitialRoute());
416 });
417}
418
419TEST_F(EngineTest, SpawnWithCustomSettings) {
420 PostUITaskSync([this] {
421 MockRuntimeDelegate client;
422 auto mock_runtime_controller =
423 std::make_unique<MockRuntimeController>(client, task_runners_);
424 auto vm_ref = DartVMRef::Create(settings_);
425 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
426 .WillRepeatedly(::testing::Return(vm_ref.get()));
427 auto engine = std::make_unique<Engine>(
428 /*delegate=*/delegate_,
429 /*dispatcher_maker=*/dispatcher_maker_,
430 /*image_decoder_task_runner=*/image_decoder_task_runner_,
431 /*task_runners=*/task_runners_,
432 /*settings=*/settings_,
433 /*animator=*/std::move(animator_),
434 /*io_manager=*/io_manager_,
435 /*font_collection=*/std::make_shared<FontCollection>(),
436 /*runtime_controller=*/std::move(mock_runtime_controller),
437 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
438
439 Settings custom_settings = settings_;
440 custom_settings.persistent_isolate_data =
441 std::make_shared<fml::DataMapping>("foo");
442 auto spawn =
443 engine->Spawn(delegate_, dispatcher_maker_, custom_settings, nullptr,
444 std::string(), io_manager_, snapshot_delegate_, nullptr);
445 EXPECT_TRUE(spawn != nullptr);
446 auto new_persistent_isolate_data =
447 const_cast<RuntimeController*>(spawn->GetRuntimeController())
448 ->GetPersistentIsolateData();
449 EXPECT_EQ(custom_settings.persistent_isolate_data->GetMapping(),
450 new_persistent_isolate_data->GetMapping());
451 EXPECT_EQ(custom_settings.persistent_isolate_data->GetSize(),
452 new_persistent_isolate_data->GetSize());
453 });
454}
455
456TEST_F(EngineTest, PassesLoadDartDeferredLibraryErrorToRuntime) {
457 PostUITaskSync([this] {
458 intptr_t error_id = 123;
459 const std::string error_message = "error message";
460 MockRuntimeDelegate client;
461 auto mock_runtime_controller =
462 std::make_unique<MockRuntimeController>(client, task_runners_);
463 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
464 .WillRepeatedly(::testing::Return(true));
465 EXPECT_CALL(*mock_runtime_controller,
466 LoadDartDeferredLibraryError(error_id, error_message, true))
467 .Times(1);
468 auto engine = std::make_unique<Engine>(
469 /*delegate=*/delegate_,
470 /*dispatcher_maker=*/dispatcher_maker_,
471 /*image_decoder_task_runner=*/image_decoder_task_runner_,
472 /*task_runners=*/task_runners_,
473 /*settings=*/settings_,
474 /*animator=*/std::move(animator_),
475 /*io_manager=*/io_manager_,
476 /*font_collection=*/std::make_shared<FontCollection>(),
477 /*runtime_controller=*/std::move(mock_runtime_controller),
478 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
479
480 engine->LoadDartDeferredLibraryError(error_id, error_message, true);
481 });
482}
483
484TEST_F(EngineTest, SpawnedEngineInheritsAssetManager) {
485 PostUITaskSync([this] {
486 MockRuntimeDelegate client;
487 auto mock_runtime_controller =
488 std::make_unique<MockRuntimeController>(client, task_runners_);
489 auto vm_ref = DartVMRef::Create(settings_);
490 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
491 .WillRepeatedly(::testing::Return(vm_ref.get()));
492
493 // auto mock_font_collection = std::make_shared<MockFontCollection>();
494 // EXPECT_CALL(*mock_font_collection, RegisterFonts(::testing::_))
495 // .WillOnce(::testing::Return());
496 auto engine = std::make_unique<Engine>(
497 /*delegate=*/delegate_,
498 /*dispatcher_maker=*/dispatcher_maker_,
499 /*image_decoder_task_runner=*/image_decoder_task_runner_,
500 /*task_runners=*/task_runners_,
501 /*settings=*/settings_,
502 /*animator=*/std::move(animator_),
503 /*io_manager=*/io_manager_,
504 /*font_collection=*/std::make_shared<FontCollection>(),
505 /*runtime_controller=*/std::move(mock_runtime_controller),
506 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
507
508 EXPECT_EQ(engine->GetAssetManager(), nullptr);
509
510 auto asset_manager = std::make_shared<AssetManager>();
511 asset_manager->PushBack(std::make_unique<FontManifestAssetResolver>());
512 engine->UpdateAssetManager(asset_manager);
513 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
514
515 auto spawn =
517 std::string(), io_manager_, snapshot_delegate_, nullptr);
518 EXPECT_TRUE(spawn != nullptr);
519 EXPECT_EQ(engine->GetAssetManager(), spawn->GetAssetManager());
520 });
521}
522
523TEST_F(EngineTest, UpdateAssetManagerWithEqualManagers) {
524 PostUITaskSync([this] {
525 MockRuntimeDelegate client;
526 auto mock_runtime_controller =
527 std::make_unique<MockRuntimeController>(client, task_runners_);
528 auto vm_ref = DartVMRef::Create(settings_);
529 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
530 .WillRepeatedly(::testing::Return(vm_ref.get()));
531
532 auto mock_font_collection = std::make_shared<MockFontCollection>();
533 EXPECT_CALL(*mock_font_collection, RegisterFonts(::testing::_))
534 .WillOnce(::testing::Return());
535 auto engine = std::make_unique<Engine>(
536 /*delegate=*/delegate_,
537 /*dispatcher_maker=*/dispatcher_maker_,
538 /*image_decoder_task_runner=*/image_decoder_task_runner_,
539 /*task_runners=*/task_runners_,
540 /*settings=*/settings_,
541 /*animator=*/std::move(animator_),
542 /*io_manager=*/io_manager_,
543 /*font_collection=*/mock_font_collection,
544 /*runtime_controller=*/std::move(mock_runtime_controller),
545 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
546
547 EXPECT_EQ(engine->GetAssetManager(), nullptr);
548
549 auto asset_manager = std::make_shared<AssetManager>();
550 asset_manager->PushBack(std::make_unique<FontManifestAssetResolver>());
551
552 auto asset_manager_2 = std::make_shared<AssetManager>();
553 asset_manager_2->PushBack(std::make_unique<FontManifestAssetResolver>());
554
555 EXPECT_NE(asset_manager, asset_manager_2);
556 EXPECT_TRUE(*asset_manager == *asset_manager_2);
557
558 engine->UpdateAssetManager(asset_manager);
559 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
560
561 engine->UpdateAssetManager(asset_manager_2);
562 // Didn't change because they're equivalent.
563 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
564 });
565}
566
567} // namespace flutter
AssetResolverType
Identifies the type of AssetResolver an instance is.
static DartVMRef Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< const DartSnapshot > isolate_snapshot=nullptr)
static MallocMapping Copy(const T *begin, const T *end)
Definition mapping.h:162
size_t mapping_call_count
int32_t value
@ kRaster
Suitable for thread which raster data.
Definition embedder.h:377
Settings settings_
std::shared_ptr< fml::ConcurrentTaskRunner > image_decoder_task_runner_
std::unique_ptr< RuntimeController > runtime_controller_
TaskRunners task_runners_
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate_
std::unique_ptr< Animator > animator_
PointerDataDispatcherMaker dispatcher_maker_
ThreadHost thread_host_
MockDelegate delegate_
fml::WeakPtr< IOManager > io_manager_
FlutterEngine engine
Definition main.cc:84
const gchar * channel
G_BEGIN_DECLS GBytes * message
Dart_NativeFunction function
Definition fuchsia.cc:50
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switch_defs.h:36
static void DispatchPlatformMessage(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jobject message, jint position, jint responseId)
bool operator==(const ViewportMetrics &a, const ViewportMetrics &b)
static void ScheduleFrame(JNIEnv *env, jobject jcaller, jlong shell_holder)
TEST_F(EngineAnimatorTest, AnimatorAcceptsMultipleRenders)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98
std::shared_ptr< const fml::Mapping > persistent_isolate_data
Definition settings.h:345
Scalar font_size