5aa86eb123
Issue https://github.com/dart-lang/sdk/issues/36097 Change-Id: I0b7eca744bc49ab5ba09da3ce2a9286b1ed3c70f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126340 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
38 lines
931 B
Dart
38 lines
931 B
Dart
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// VMOptions=--enable-isolate-groups
|
|
// VMOptions=--no-enable-isolate-groups
|
|
|
|
import 'dart:isolate';
|
|
import 'dart:nativewrappers';
|
|
import 'package:expect/expect.dart';
|
|
import 'package:async_helper/async_helper.dart';
|
|
|
|
echo(msg) {
|
|
var data = msg[0];
|
|
var reply = msg[1];
|
|
reply.send('echoing ${data(1)}}');
|
|
}
|
|
|
|
class Test extends NativeFieldWrapperClass2 {
|
|
Test(this.i, this.j);
|
|
int i, j;
|
|
}
|
|
|
|
main() {
|
|
var port = new RawReceivePort();
|
|
var obj = new Test(1, 2);
|
|
var msg = [obj, port.sendPort];
|
|
var snd = Isolate.spawn(echo, msg);
|
|
|
|
asyncStart();
|
|
snd.catchError((e) {
|
|
Expect.isTrue(e is ArgumentError);
|
|
Expect.isTrue("$e".contains("NativeWrapper"));
|
|
port.close();
|
|
asyncEnd();
|
|
});
|
|
}
|