OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override |
| 5 |
| 6 import 'package:observatory/service_io.dart'; |
| 7 import 'package:unittest/unittest.dart'; |
| 8 import 'test_helper.dart'; |
| 9 import 'dart:async'; |
| 10 import 'dart:developer'; |
| 11 |
| 12 class Point { |
| 13 int x, y; |
| 14 Point(this.x, this.y); |
| 15 } |
| 16 |
| 17 void testeeDo() { |
| 18 Debugger.inspect(new Point(3, 4)); |
| 19 } |
| 20 |
| 21 var tests = [ |
| 22 |
| 23 (Isolate isolate) async { |
| 24 Completer completer = new Completer(); |
| 25 var subscription; |
| 26 subscription = isolate.vm.events.stream.listen((ServiceEvent event) { |
| 27 print(event); |
| 28 if (event.eventType == ServiceEvent.kInspect) { |
| 29 expect((event.inspectee as Instance).clazz.name, equals('Point')); |
| 30 |
| 31 subscription.cancel(); |
| 32 completer.complete(); |
| 33 } |
| 34 }); |
| 35 |
| 36 // Start listening for events first. |
| 37 await isolate.eval(isolate.rootLib, 'testeeDo();'); |
| 38 return completer.future; |
| 39 }, |
| 40 |
| 41 ]; |
| 42 |
| 43 main(args) => runIsolateTests(args, tests); |
OLD | NEW |