| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--error_on_bad_type --error_on_bad_override | 4 // VMOptions=--error_on_bad_type --error_on_bad_override |
| 5 | 5 |
| 6 library set_library_debuggable_test; | 6 library set_library_debuggable_test; |
| 7 | 7 |
| 8 import 'dart:developer'; | 8 import 'dart:developer'; |
| 9 import 'package:observatory/service_io.dart'; | 9 import 'package:observatory/service_io.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 11 import 'service_test_common.dart'; | 11 import 'service_test_common.dart'; |
| 12 import 'test_helper.dart'; | 12 import 'test_helper.dart'; |
| 13 | 13 |
| 14 const LINE_A = 20; | 14 const LINE_A = 20; |
| 15 const LINE_B = 21; | 15 const LINE_B = 21; |
| 16 const LINE_C = 22; | 16 const LINE_C = 22; |
| 17 | 17 |
| 18 testMain() async { | 18 testMain() async { |
| 19 debugger(); | 19 debugger(); |
| 20 print('hi'); // LINE_A. | 20 print('hi'); // LINE_A. |
| 21 print('yep'); // LINE_B. | 21 print('yep'); // LINE_B. |
| 22 print('zoo'); // LINE_C. | 22 print('zoo'); // LINE_C. |
| 23 } | 23 } |
| 24 | 24 |
| 25 var tests = [ | 25 var tests = [ |
| 26 hasStoppedAtBreakpoint, |
| 27 markDartColonLibrariesDebuggable, |
| 26 (Isolate isolate) async { | 28 (Isolate isolate) async { |
| 27 await isolate.reload(); | 29 await isolate.reload(); |
| 28 Library dartCore = isolate.libraries.firstWhere( | 30 Library dartCore = isolate.libraries.firstWhere( |
| 29 (Library library) => library.uri == 'dart:core'); | 31 (Library library) => library.uri == 'dart:core'); |
| 30 await dartCore.load(); | 32 await dartCore.reload(); |
| 31 expect(dartCore.debuggable, equals(true)); | 33 expect(dartCore.debuggable, equals(true)); |
| 32 }, | 34 }, |
| 33 stoppedInFunction('testMain', contains:true), | 35 stoppedInFunction('testMain', contains:true), |
| 34 stoppedAtLine(LINE_A), | 36 stoppedAtLine(LINE_A), |
| 35 stepInto, | 37 stepInto, |
| 36 stoppedInFunction('print'), | 38 stoppedInFunction('print'), |
| 37 stepOut, | 39 stepOut, |
| 38 stoppedInFunction('testMain', contains:true), | 40 stoppedInFunction('testMain', contains:true), |
| 39 stoppedAtLine(LINE_B), | 41 stoppedAtLine(LINE_B), |
| 40 (Isolate isolate) async { | 42 (Isolate isolate) async { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 56 expect(dartCore.debuggable, equals(false)); | 58 expect(dartCore.debuggable, equals(false)); |
| 57 }, | 59 }, |
| 58 stoppedInFunction('testMain', contains:true), | 60 stoppedInFunction('testMain', contains:true), |
| 59 stoppedAtLine(LINE_B), | 61 stoppedAtLine(LINE_B), |
| 60 stepInto, | 62 stepInto, |
| 61 stoppedInFunction('testMain', contains:true), | 63 stoppedInFunction('testMain', contains:true), |
| 62 stoppedAtLine(LINE_C), | 64 stoppedAtLine(LINE_C), |
| 63 ]; | 65 ]; |
| 64 | 66 |
| 65 main(args) async => runIsolateTests(args, tests, testeeConcurrent: testMain); | 67 main(args) async => runIsolateTests(args, tests, testeeConcurrent: testMain); |
| OLD | NEW |