Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
|
zra
2016/07/28 20:17:47
2016
rmacnak
2016/07/28 20:40:53
Done.
| |
| 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=--error_on_bad_type --error_on_bad_override --verbose_debug | |
| 5 | |
| 6 // This test is mostly interesting for DBC, which needs to patch two bytecodes | |
| 7 // to create a breakpoint for fast Smi ops. | |
| 8 | |
| 9 import 'package:observatory/service_io.dart'; | |
| 10 import 'package:unittest/unittest.dart'; | |
| 11 import 'service_test_common.dart'; | |
| 12 import 'test_helper.dart'; | |
| 13 import 'dart:developer'; | |
| 14 | |
| 15 const int LINE_A = 26; | |
| 16 const int LINE_B = 27; | |
| 17 const int LINE_C = 28; | |
| 18 | |
| 19 class NotGeneric { } | |
| 20 | |
| 21 testeeMain() { | |
| 22 var x = new List(1); | |
| 23 var y = 7; | |
| 24 debugger(); | |
| 25 print("Statement"); | |
| 26 x[0] = 3; // Line A. | |
| 27 x is NotGeneric; // Line B. | |
| 28 y & 4; // Line C. | |
| 29 } | |
| 30 | |
| 31 var tests = [ | |
| 32 | |
| 33 hasStoppedAtBreakpoint, | |
| 34 | |
| 35 // Add breakpoints. | |
| 36 (Isolate isolate) async { | |
| 37 var rootLib = await isolate.rootLibrary.load(); | |
| 38 var script = rootLib.scripts[0]; | |
| 39 | |
| 40 var bpt1 = await isolate.addBreakpoint(script, LINE_A); | |
| 41 print(bpt1); | |
| 42 expect(bpt1.resolved, isTrue); | |
| 43 expect(await bpt1.location.getLine(), equals(LINE_A)); | |
| 44 | |
| 45 var bpt2 = await isolate.addBreakpoint(script, LINE_B); | |
| 46 print(bpt2); | |
| 47 expect(bpt2.resolved, isTrue); | |
| 48 expect(await bpt2.location.getLine(), equals(LINE_B)); | |
| 49 | |
| 50 var bpt3 = await isolate.addBreakpoint(script, LINE_C); | |
| 51 print(bpt3); | |
| 52 expect(bpt3.resolved, isTrue); | |
| 53 expect(await bpt3.location.getLine(), equals(LINE_C)); | |
| 54 }, | |
| 55 | |
| 56 resumeIsolate, | |
| 57 | |
| 58 hasStoppedAtBreakpoint, | |
| 59 stoppedAtLine(LINE_A), | |
| 60 resumeIsolate, | |
| 61 | |
| 62 hasStoppedAtBreakpoint, | |
| 63 stoppedAtLine(LINE_B), | |
| 64 resumeIsolate, | |
| 65 | |
| 66 hasStoppedAtBreakpoint, | |
| 67 stoppedAtLine(LINE_C), | |
| 68 resumeIsolate, | |
| 69 | |
| 70 ]; | |
| 71 | |
| 72 main(args) => runIsolateTests(args, tests, testeeConcurrent: testeeMain); | |
| OLD | NEW |