OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, 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 |
| 5 import 'dart:async'; |
| 6 import 'dart:developer'; |
| 7 import 'package:observatory/service_io.dart'; |
| 8 import 'package:unittest/unittest.dart'; |
| 9 import 'service_test_common.dart'; |
| 10 import 'test_helper.dart'; |
| 11 |
| 12 testFunction() async { |
| 13 var x = 3; |
| 14 var y = 4; |
| 15 debugger(); |
| 16 var z = await new Future(() => x + y); |
| 17 debugger(); |
| 18 return z; |
| 19 } |
| 20 |
| 21 var tests = [ |
| 22 |
| 23 hasStoppedAtBreakpoint, |
| 24 |
| 25 (Isolate isolate) async { |
| 26 // Make sure we are in the right place. |
| 27 var stack = await isolate.getStack(); |
| 28 var topFrame = 0; |
| 29 expect(stack.type, equals('Stack')); |
| 30 expect(await stack['frames'][topFrame].location.getLine(), 16); |
| 31 |
| 32 var result = await isolate.evalFrame(topFrame, "x"); |
| 33 print(result); |
| 34 expect(result.valueAsString, equals("3")); |
| 35 }, |
| 36 |
| 37 resumeIsolate, |
| 38 |
| 39 hasStoppedAtBreakpoint, |
| 40 |
| 41 (Isolate isolate) async { |
| 42 // Make sure we are in the right place. |
| 43 var stack = await isolate.getStack(); |
| 44 var topFrame = 0; |
| 45 expect(stack.type, equals('Stack')); |
| 46 expect(await stack['frames'][topFrame].location.getLine(), 18); |
| 47 |
| 48 var result = await isolate.evalFrame(topFrame, "z"); |
| 49 print(result); |
| 50 expect(result.valueAsString, equals("7")); |
| 51 }, |
| 52 |
| 53 resumeIsolate, |
| 54 |
| 55 ]; |
| 56 |
| 57 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); |
OLD | NEW |