5#include "flutter/shell/platform/linux/public/flutter_linux/fl_dart_project.h"
11#include "gtest/gtest.h"
13TEST(FlDartProjectTest, GetPaths) {
15 g_autofree gchar* exe_path = g_file_read_link(
"/proc/self/exe",
nullptr);
16 ASSERT_TRUE(exe_path !=
nullptr);
17 g_autofree gchar*
dir = g_path_get_dirname(exe_path);
18 g_autofree gchar* expected_aot_library_path =
19 g_build_filename(
dir,
"lib",
"libapp.so",
nullptr);
21 expected_aot_library_path);
22 g_autofree gchar* expected_assets_path =
23 g_build_filename(
dir,
"data",
"flutter_assets",
nullptr);
25 g_autofree gchar* expected_icu_data_path =
26 g_build_filename(
dir,
"data",
"icudtl.dat",
nullptr);
28 expected_icu_data_path);
31TEST(FlDartProjectTest, OverrideAotLibraryPath) {
34 char aot_library_path[] =
"/normal/tuesday/night/for/shia/labeouf";
39TEST(FlDartProjectTest, OverrideAssetsPath) {
42 char assets_path[] =
"/normal/tuesday/night/for/shia/labeouf";
47TEST(FlDartProjectTest, OverrideIcuDataPath) {
50 char icu_data_path[] =
"/living/in/the/woods/icudtl.dat";
55TEST(FlDartProjectTest, DartEntrypointArgs) {
58 char** retrieved_args =
61 EXPECT_EQ(retrieved_args,
nullptr);
63 GPtrArray* args_array = g_ptr_array_new();
64 g_ptr_array_add(args_array,
const_cast<char*
>(
"arg_one"));
65 g_ptr_array_add(args_array,
const_cast<char*
>(
"arg_two"));
66 g_ptr_array_add(args_array,
const_cast<char*
>(
"arg_three"));
67 g_ptr_array_add(args_array,
nullptr);
68 gchar**
args =
reinterpret_cast<gchar**
>(g_ptr_array_free(args_array,
false));
75 EXPECT_NE(retrieved_args,
args);
77 EXPECT_EQ(g_strv_length(retrieved_args), 3U);
G_MODULE_EXPORT const gchar * fl_dart_project_get_assets_path(FlDartProject *self)
G_MODULE_EXPORT const gchar * fl_dart_project_get_aot_library_path(FlDartProject *self)
G_MODULE_EXPORT void fl_dart_project_set_icu_data_path(FlDartProject *self, gchar *path)
G_MODULE_EXPORT void fl_dart_project_set_dart_entrypoint_arguments(FlDartProject *self, char **argv)
G_MODULE_EXPORT const gchar * fl_dart_project_get_icu_data_path(FlDartProject *self)
G_MODULE_EXPORT gchar ** fl_dart_project_get_dart_entrypoint_arguments(FlDartProject *self)
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()
G_MODULE_EXPORT void fl_dart_project_set_assets_path(FlDartProject *self, gchar *path)
G_MODULE_EXPORT void fl_dart_project_set_aot_library_path(FlDartProject *self, const gchar *path)
TEST(FlDartProjectTest, GetPaths)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
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 vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir