Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4bb0274

Browse files
committed
Fix host unittests
1 parent a285002 commit 4bb0274

File tree

3 files changed

+42
-36
lines changed

3 files changed

+42
-36
lines changed

runtime/dart_isolate_unittests.cc

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "flutter/fml/synchronization/count_down_latch.h"
99
#include "flutter/fml/synchronization/waitable_event.h"
1010
#include "flutter/fml/thread.h"
11+
#include "flutter/runtime/dart_deferred_load_handler.h"
1112
#include "flutter/runtime/dart_vm.h"
1213
#include "flutter/runtime/dart_vm_lifecycle.h"
1314
#include "flutter/testing/dart_isolate_runner.h"
@@ -47,18 +48,19 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) {
4748
GetCurrentTaskRunner() //
4849
);
4950
auto weak_isolate = DartIsolate::CreateRootIsolate(
50-
vm_data->GetSettings(), // settings
51-
vm_data->GetIsolateSnapshot(), // isolate snapshot
52-
std::move(task_runners), // task runners
53-
nullptr, // window
54-
{}, // snapshot delegate
55-
{}, // hint freed delegate
56-
{}, // io manager
57-
{}, // unref queue
58-
{}, // image decoder
59-
"main.dart", // advisory uri
60-
"main", // advisory entrypoint,
61-
nullptr, // flags
51+
vm_data->GetSettings(), // settings
52+
vm_data->GetIsolateSnapshot(), // isolate snapshot
53+
std::move(task_runners), // task runners
54+
nullptr, // window
55+
{}, // snapshot delegate
56+
{}, // hint freed delegate
57+
{}, // io manager
58+
{}, // unref queue
59+
{}, // image decoder
60+
"main.dart", // advisory uri
61+
"main", // advisory entrypoint,
62+
nullptr, // flags
63+
DartDeferredLoadHandler::empty_dart_deferred_load_handler,
6264
settings.isolate_create_callback, // isolate create callback
6365
settings.isolate_shutdown_callback // isolate shutdown callback
6466
);
@@ -82,18 +84,19 @@ TEST_F(DartIsolateTest, IsolateShutdownCallbackIsInIsolateScope) {
8284
GetCurrentTaskRunner() //
8385
);
8486
auto weak_isolate = DartIsolate::CreateRootIsolate(
85-
vm_data->GetSettings(), // settings
86-
vm_data->GetIsolateSnapshot(), // isolate snapshot
87-
std::move(task_runners), // task runners
88-
nullptr, // window
89-
{}, // snapshot delegate
90-
{}, // hint freed delegate
91-
{}, // io manager
92-
{}, // unref queue
93-
{}, // image decoder
94-
"main.dart", // advisory uri
95-
"main", // advisory entrypoint
96-
nullptr, // flags
87+
vm_data->GetSettings(), // settings
88+
vm_data->GetIsolateSnapshot(), // isolate snapshot
89+
std::move(task_runners), // task runners
90+
nullptr, // window
91+
{}, // snapshot delegate
92+
{}, // hint freed delegate
93+
{}, // io manager
94+
{}, // unref queue
95+
{}, // image decoder
96+
"main.dart", // advisory uri
97+
"main", // advisory entrypoint
98+
nullptr, // flags
99+
DartDeferredLoadHandler::empty_dart_deferred_load_handler,
97100
settings.isolate_create_callback, // isolate create callback
98101
settings.isolate_shutdown_callback // isolate shutdown callback
99102
);

runtime/dart_lifecycle_unittests.cc

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "flutter/fml/paths.h"
77
#include "flutter/fml/synchronization/count_down_latch.h"
88
#include "flutter/fml/synchronization/waitable_event.h"
9+
#include "flutter/runtime/dart_deferred_load_handler.h"
910
#include "flutter/runtime/dart_vm.h"
1011
#include "flutter/runtime/dart_vm_lifecycle.h"
1112
#include "flutter/testing/fixture_test.h"
@@ -51,18 +52,19 @@ static std::shared_ptr<DartIsolate> CreateAndRunRootIsolate(
5152
TaskRunners runners("io.flutter.test", task_runner, task_runner, task_runner,
5253
task_runner);
5354
auto isolate_weak = DartIsolate::CreateRootIsolate(
54-
vm.GetSettings(), // settings
55-
vm.GetIsolateSnapshot(), // isolate_snapshot
56-
runners, // task_runners
57-
{}, // window
58-
{}, // snapshot_delegate
59-
{}, // hint_freed_delegate
60-
{}, // io_manager
61-
{}, // unref_queue
62-
{}, // image_decoder
63-
"main.dart", // advisory_script_uri
64-
entrypoint.c_str(), // advisory_script_entrypoint
65-
nullptr, // flags
55+
vm.GetSettings(), // settings
56+
vm.GetIsolateSnapshot(), // isolate_snapshot
57+
runners, // task_runners
58+
{}, // window
59+
{}, // snapshot_delegate
60+
{}, // hint_freed_delegate
61+
{}, // io_manager
62+
{}, // unref_queue
63+
{}, // image_decoder
64+
"main.dart", // advisory_script_uri
65+
entrypoint.c_str(), // advisory_script_entrypoint
66+
nullptr, // flags
67+
DartDeferredLoadHandler::empty_dart_deferred_load_handler,
6668
settings.isolate_create_callback, // isolate create callback
6769
settings.isolate_shutdown_callback // isolate shutdown callback
6870
);

shell/common/engine_unittests.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class MockRuntimeDelegate : public RuntimeDelegate {
5656
MOCK_METHOD1(ComputePlatformResolvedLocale,
5757
std::unique_ptr<std::vector<std::string>>(
5858
const std::vector<std::string>&));
59+
MOCK_METHOD1(OnDartLoadLibrary, Dart_Handle(intptr_t));
5960
};
6061

6162
class MockRuntimeController : public RuntimeController {

0 commit comments

Comments
 (0)