23const std::string
kElfFileName =
"plugin_registrant_app_elf_snapshot.so";
37 if (source_path[0] !=
'/') {
39 source_path =
"/" + source_path;
41 std::string registrant_uri = std::string(
"file://") + source_path +
42 "flutter/runtime/fixtures/dart_tool/"
43 "flutter_build/dart_plugin_registrant.dart";
55#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
56 GTEST_SKIP() <<
"Dart_LoadELF is not implemented on Fuchsia.";
60 std::vector<std::string> messages;
67 Dart_GetNativeArgument(
args, 0));
72 auto settings = CreateSettingsForFixture();
73 auto did_throw_exception =
false;
74 settings.unhandled_exception_callback = [&](
const std::string&
error,
75 const std::string& stack_trace) {
76 did_throw_exception =
true;
81 auto thread = CreateNewThread();
93 "mainForPluginRegistrantTest", {}, kernel_path);
100 ASSERT_EQ(messages.size(), 1u);
101 ASSERT_EQ(messages[0],
"_PluginRegistrant.register() was called");
106#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
107 GTEST_SKIP() <<
"Dart_LoadELF is not implemented on Fuchsia.";
111 std::vector<std::string> messages;
118 Dart_GetNativeArgument(
args, 0));
123 auto settings = CreateSettingsForFixture();
124 auto did_throw_exception =
false;
125 settings.unhandled_exception_callback = [&](
const std::string&
error,
126 const std::string& stack_trace) {
127 did_throw_exception =
true;
132 auto thread = CreateNewThread();
143 vm_ref, settings, task_runners,
144 "callDartPluginRegistrantFromBackgroundIsolate", {}, kernel_path);
146 ASSERT_TRUE(isolate);
151 ASSERT_EQ(messages.size(), 1u);
152 ASSERT_EQ(messages[0],
153 "_PluginRegistrant.register() was called on background isolate");
158#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
159 GTEST_SKIP() <<
"Dart_LoadELF is not implemented on Fuchsia.";
163 std::vector<std::string> messages;
170 Dart_GetNativeArgument(
args, 0));
175 auto settings = CreateSettingsForFixture();
176 auto did_throw_exception =
false;
177 settings.unhandled_exception_callback = [&](
const std::string&
error,
178 const std::string& stack_trace) {
179 did_throw_exception =
true;
184 auto thread = CreateNewThread();
195 vm_ref, settings, task_runners,
196 "dontCallDartPluginRegistrantFromBackgroundIsolate", {}, kernel_path);
198 ASSERT_TRUE(isolate);
203 ASSERT_EQ(messages.size(), 1u);
206 "_PluginRegistrant.register() was not called on background isolate");
211#if defined(OS_FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DEBUG)
212 GTEST_SKIP() <<
"Dart_LoadELF is not implemented on Fuchsia.";
216 std::vector<std::string> messages;
223 Dart_GetNativeArgument(
args, 0));
228 auto settings = CreateSettingsForFixture();
229 auto did_throw_exception =
false;
230 settings.unhandled_exception_callback = [&](
const std::string&
error,
231 const std::string& stack_trace) {
232 did_throw_exception =
true;
237 auto thread = CreateNewThread();
248 vm_ref, settings, task_runners,
249 "registerBackgroundIsolateCallsDartPluginRegistrant", {}, kernel_path);
251 ASSERT_TRUE(isolate);
256 ASSERT_EQ(messages.size(), 1u);
257 ASSERT_EQ(messages[0],
258 "_PluginRegistrant.register() was called on background isolate");
static DartVMRef Create(const Settings &settings, fml::RefPtr< const DartSnapshot > vm_snapshot=nullptr, fml::RefPtr< const DartSnapshot > isolate_snapshot=nullptr)
static bool IsInstanceRunning()
std::string dart_plugin_registrant_library_
void OverrideDartPluginRegistrant(const std::string &override_value)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_BEGIN_DECLS GBytes * message
const uint8_t uint32_t uint32_t GError ** error
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
TEST_F(DisplayListTest, Defaults)
std::unique_ptr< AutoIsolateShutdown > RunDartCodeInIsolate(DartVMRef &vm_ref, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &kernel_file_path, fml::WeakPtr< IOManager > io_manager, std::unique_ptr< PlatformConfiguration > platform_configuration)
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
const char * GetSourcePath()
const std::string kElfFileName
const std::string kKernelFileName
const char * dart_plugin_registrant_library_override
std::string JoinPaths(std::initializer_list< std::string > components)
#define CREATE_NATIVE_ENTRY(native_entry)