398ba13e4a
Change-Id: I6e4da0da6c3f635d84380b384ae17fbb55587895 Reviewed-on: https://dart-review.googlesource.com/58721 Reviewed-by: Vyacheslav Egorov <vegorov@google.com> Commit-Queue: Florian Loitsch <floitsch@google.com>
35 lines
853 B
Dart
35 lines
853 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.
|
|
|
|
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();
|
|
});
|
|
}
|