| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 | 4 |
| 5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 #include "vm/unit_test.h" | 6 #include "vm/unit_test.h" |
| 7 | 7 |
| 8 namespace dart { | 8 namespace dart { |
| 9 | 9 |
| 10 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) { | 10 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 debugger->SetBreakpointAtLine(url, 3); | 37 debugger->SetBreakpointAtLine(url, 3); |
| 38 { | 38 { |
| 39 JSONStream js; | 39 JSONStream js; |
| 40 { | 40 { |
| 41 JSONArray jsarr(&js); | 41 JSONArray jsarr(&js); |
| 42 debugger->PrintBreakpointsToJSONArray(&jsarr); | 42 debugger->PrintBreakpointsToJSONArray(&jsarr); |
| 43 } | 43 } |
| 44 EXPECT_STREQ( | 44 EXPECT_STREQ( |
| 45 "[{\"type\":\"Breakpoint\",\"id\":2," | 45 "[{\"type\":\"Breakpoint\",\"id\":2," |
| 46 "\"enabled\":true,\"resolved\":false," | 46 "\"enabled\":true,\"resolved\":false," |
| 47 "\"location\":{\"type\":\"Location\",\"libId\":12," | 47 "\"location\":{\"type\":\"Location\"," |
| 48 "\"script\":\"dart:test-lib\",\"tokenPos\":14}}," | 48 "\"script\":\"dart:test-lib\",\"tokenPos\":14}}," |
| 49 "{\"type\":\"Breakpoint\",\"id\":1," | 49 "{\"type\":\"Breakpoint\",\"id\":1," |
| 50 "\"enabled\":true,\"resolved\":false," | 50 "\"enabled\":true,\"resolved\":false," |
| 51 "\"location\":{\"type\":\"Location\",\"libId\":12," | 51 "\"location\":{\"type\":\"Location\"," |
| 52 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}]", | 52 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}]", |
| 53 js.ToCString()); | 53 js.ToCString()); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 static bool saw_paused_event = false; | 58 static bool saw_paused_event = false; |
| 59 | 59 |
| 60 static void InspectPausedEvent(Dart_IsolateId isolate_id, | 60 static void InspectPausedEvent(Dart_IsolateId isolate_id, |
| 61 intptr_t bp_id, | 61 intptr_t bp_id, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 EXPECT_VALID(result); | 100 EXPECT_VALID(result); |
| 101 EXPECT(Dart_IsString(result)); | 101 EXPECT(Dart_IsString(result)); |
| 102 | 102 |
| 103 // We ran the code in InspectPausedEvent. | 103 // We ran the code in InspectPausedEvent. |
| 104 EXPECT(saw_paused_event); | 104 EXPECT(saw_paused_event); |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 | 108 |
| 109 } // namespace dart | 109 } // namespace dart |
| OLD | NEW |