未验证 提交 cb3d3592 编写于 作者: S Siva 提交者: GitHub

Add embedder unit test that reproduces https://github.com/dart-lang/sdk/issues/46275 (#27392)

* Add embedder unit test that reproduces the problem described in
https://github.com/dart-lang/sdk/issues/46275

* Address code review comments.
上级 78c0e2e7
......@@ -3,12 +3,13 @@
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert';
import 'dart:core';
import 'dart:ffi';
import 'dart:io';
import 'dart:isolate';
import 'dart:typed_data';
import 'dart:ui';
import 'dart:isolate';
import 'dart:ffi';
import 'dart:core';
import 'dart:convert';
void main() {}
......@@ -32,6 +33,14 @@ void sayHiFromCustomEntrypoint2() native 'SayHiFromCustomEntrypoint2';
void sayHiFromCustomEntrypoint3() native 'SayHiFromCustomEntrypoint3';
@pragma('vm:entry-point')
void terminateExitCodeHandler() {
final ProcessResult result = Process.runSync(
'ls', <String>[]
);
}
@pragma('vm:entry-point')
void invokePlatformTaskRunner() {
PlatformDispatcher.instance.sendPlatformMessage('OhHi', null, null);
......
......@@ -123,6 +123,15 @@ TEST_F(EmbedderTest, CanInvokeCustomEntrypointMacro) {
ASSERT_TRUE(engine.is_valid());
}
TEST_F(EmbedderTest, CanTerminateCleanly) {
auto& context = GetEmbedderContext(EmbedderTestContextType::kSoftwareContext);
EmbedderConfigBuilder builder(context);
builder.SetSoftwareRendererConfig();
builder.SetDartEntrypoint("terminateExitCodeHandler");
auto engine = builder.LaunchEngine();
ASSERT_TRUE(engine.is_valid());
}
std::atomic_size_t EmbedderTestTaskRunner::sEmbedderTaskRunnerIdentifiers = {};
TEST_F(EmbedderTest, CanSpecifyCustomPlatformTaskRunner) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册