1717import 'dart:async' ;
1818import 'dart:concurrent' ;
1919import 'dart:ffi' ;
20- import 'dart:io' ;
2120import 'dart:isolate' ;
2221
23- import 'package:dart_internal/isolate_group.dart' show IsolateGroup;
2422import "package:expect/async_helper.dart" ;
2523import "package:expect/expect.dart" ;
2624
@@ -204,13 +202,13 @@ void testNativeCallableSync() {
204202
205203void testNativeCallableSyncThrows () {
206204 final callback =
207- NativeCallable <CallbackReturningIntNativeType >.isolateGroupShared ((
208- int a,
209- int b,
210- ) {
211- throw "foo" ;
212- return a + b;
213- }, exceptionalReturn : 1111 );
205+ NativeCallable <CallbackReturningIntNativeType >.isolateGroupShared (
206+ ( int a, int b) {
207+ throw "foo" ;
208+ }
209+ as int Function ( int , int ),
210+ exceptionalReturn : 1111 ,
211+ );
214212
215213 Expect .equals (
216214 1111 ,
@@ -242,15 +240,17 @@ Future<void> testKeepIsolateAliveTrue() async {
242240 mutexCondvar = Mutex ();
243241 conditionVariable = ConditionVariable ();
244242 ReceivePort rpOnExit = ReceivePort ("onExit" );
245- Isolate .spawn (
246- (_) async {
247- final callback = NativeCallable <CallbackNativeType >.isolateGroupShared (
248- simpleFunction,
249- );
250- callback.keepIsolateAlive = true ;
251- },
252- /*message=*/ null ,
253- onExit: rpOnExit.sendPort,
243+ unawaited (
244+ Isolate .spawn (
245+ (_) async {
246+ final callback = NativeCallable <CallbackNativeType >.isolateGroupShared (
247+ simpleFunction,
248+ );
249+ callback.keepIsolateAlive = true ;
250+ },
251+ /*message=*/ null ,
252+ onExit: rpOnExit.sendPort,
253+ ),
254254 );
255255 try {
256256 await rpOnExit.first.timeout (Duration (seconds: 5 ));
@@ -267,15 +267,17 @@ Future<void> testKeepIsolateAliveFalse() async {
267267 mutexCondvar = Mutex ();
268268 conditionVariable = ConditionVariable ();
269269 ReceivePort rpOnExit = ReceivePort ("onExit" );
270- Isolate .spawn (
271- (_) async {
272- final callback = NativeCallable <CallbackNativeType >.isolateGroupShared (
273- simpleFunction,
274- );
275- callback.keepIsolateAlive = false ;
276- },
277- /*message=*/ null ,
278- onExit: rpOnExit.sendPort,
270+ unawaited (
271+ Isolate .spawn (
272+ (_) async {
273+ final callback = NativeCallable <CallbackNativeType >.isolateGroupShared (
274+ simpleFunction,
275+ );
276+ callback.keepIsolateAlive = false ;
277+ },
278+ /*message=*/ null ,
279+ onExit: rpOnExit.sendPort,
280+ ),
279281 );
280282 try {
281283 await rpOnExit.first.timeout (Duration (seconds: 30 ));
0 commit comments