31 "import 'dart:isolate';\n"
33 "var _nullPrintClosure = (String line) {};\n"
34 "var _platformScript = () => Uri.parse(\"%s\");\n"
35 "void entry(message) {}\n"
37 " Isolate.spawn(entry, null);\n"
40 " var rp = RawReceivePort();\n"
41 " rp.sendPort.send(null);\n"
42 " rp.handler = (_) { rp.close(); };\n"
44 platform_script_value);
82 args[0] = schedule_immediate_closure;
96 "Lightweight isolate spawn is not supported by this Dart embedder");
116 : thread_(thread), barrier_(barrier) {}
119 const bool kBypassSafepoint =
false;
132 (limit == thread_->saved_stack_limit_) ||
170 uword interrupts = thread->GetAndClearInterrupts();
178 auto isolate = thread->isolate();
181 EXPECT(!isolate->HasLivePorts());
185 port = isolate->CreateReceivePort(String::null_string());
190 EXPECT(isolate->HasLivePorts());
193 isolate->SetReceivePortKeepAliveState(
port,
false);
196 EXPECT(!isolate->HasLivePorts());
199 isolate->SetReceivePortKeepAliveState(
port,
true);
202 EXPECT(isolate->HasLivePorts());
205 isolate->CloseReceivePort(
port);
208 EXPECT(!isolate->HasLivePorts());
211 isolate->CloseReceivePort(
port);
214 EXPECT(!isolate->HasLivePorts());
219 port = isolate->CreateReceivePort(String::null_string());
220 EXPECT_NE(0,
port.Id());
222 EXPECT(isolate->HasLivePorts());
225 isolate->SetReceivePortKeepAliveState(
port,
false);
228 EXPECT(!isolate->HasLivePorts());
231 isolate->CloseReceivePort(
port);
234 EXPECT(!isolate->HasLivePorts());
237 EXPECT(!isolate->HasLivePorts());
243 EXPECT_EQ(
false, thread->is_unwind_in_progress());
261 EXPECT_EQ(
true, thread->is_unwind_in_progress());
267 EXPECT_EQ(
false, thread->is_unwind_in_progress());
289 EXPECT_EQ(
false, thread->is_unwind_in_progress());
static ThreadPool * thread_pool()
static constexpr intptr_t kIterations
static constexpr intptr_t kTaskCount
InterruptChecker(Thread *thread, ThreadBarrier *barrier)
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
static Dart_Handle LoadTestScript(const char *script, Dart_NativeEntryResolver resolver, const char *lib_uri=RESOLVED_USER_TEST_URI, bool finalize=true, bool allow_compile_errors=false)
static Dart_Isolate CreateTestIsolate(const char *name=nullptr, void *isolate_group_data=nullptr, void *isolate_data=nullptr)
bool Run(Args &&... args)
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
uword stack_limit_address() const
IsolateGroup * isolate_group() const
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
struct _Dart_Handle * Dart_Handle
struct _Dart_Isolate * Dart_Isolate
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
DART_EXPORT void Dart_EnterScope()
DART_EXPORT Dart_Handle Dart_False()
DART_EXPORT bool Dart_ErrorHasException(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle class_name)
void IsolateSpawn(const char *platform_script_value)
DART_EXPORT bool Dart_IsUnhandledExceptionError(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_GetNonNullableType(Dart_Handle library, Dart_Handle class_name, intptr_t number_of_type_arguments, Dart_Handle *type_arguments)
DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name)
DART_EXPORT Dart_Isolate Dart_CurrentIsolate()
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
ISOLATE_UNIT_TEST_CASE(StackAllocatedDestruction)
DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container, Dart_Handle name, Dart_Handle value)
TEST_CASE(DirectoryCurrent)
Dart_Handle NewString(const char *str)
DART_EXPORT Dart_Handle Dart_RunLoop()
DART_EXPORT void Dart_ExitScope()
DART_EXPORT Dart_Handle Dart_ErrorGetException(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)
DART_EXPORT void Dart_ShutdownIsolate()
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)
DART_EXPORT bool Dart_IsFatalError(Dart_Handle object)
VM_UNIT_TEST_CASE(DirectoryCurrentNoScope)
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 port
def print(*args, **kwargs)
#define EXPECT_ERROR(handle, substring)
#define EXPECT_VALID(handle)