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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
6 #include "vm/dart_api_impl.h" | 6 #include "vm/dart_api_impl.h" |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/message_handler.h" | 10 #include "vm/message_handler.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 isolate->debugger()->SetBreakpointAtLine(url, 3); | 80 isolate->debugger()->SetBreakpointAtLine(url, 3); |
81 | 81 |
82 // Get the breakpoint list. | 82 // Get the breakpoint list. |
83 service_msg = Eval(lib, "[port, ['debug', 'breakpoints'], [], []]"); | 83 service_msg = Eval(lib, "[port, ['debug', 'breakpoints'], [], []]"); |
84 Service::HandleServiceMessage(isolate, service_msg); | 84 Service::HandleServiceMessage(isolate, service_msg); |
85 handler.HandleNextMessage(); | 85 handler.HandleNextMessage(); |
86 EXPECT_STREQ( | 86 EXPECT_STREQ( |
87 "{\"type\":\"BreakpointList\",\"breakpoints\":[{" | 87 "{\"type\":\"BreakpointList\",\"breakpoints\":[{" |
88 "\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true," | 88 "\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true," |
89 "\"resolved\":false," | 89 "\"resolved\":false," |
90 "\"location\":{\"type\":\"Location\",\"libId\":12," | 90 "\"location\":{\"type\":\"Location\"," |
91 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}]}", | 91 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}]}", |
92 handler.msg()); | 92 handler.msg()); |
93 | 93 |
94 // Individual breakpoint. | 94 // Individual breakpoint. |
95 service_msg = Eval(lib, "[port, ['debug', 'breakpoints', '1'], [], []]"); | 95 service_msg = Eval(lib, "[port, ['debug', 'breakpoints', '1'], [], []]"); |
96 Service::HandleServiceMessage(isolate, service_msg); | 96 Service::HandleServiceMessage(isolate, service_msg); |
97 handler.HandleNextMessage(); | 97 handler.HandleNextMessage(); |
98 EXPECT_STREQ( | 98 EXPECT_STREQ( |
99 "{\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true," | 99 "{\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true," |
100 "\"resolved\":false," | 100 "\"resolved\":false," |
101 "\"location\":{\"type\":\"Location\",\"libId\":12," | 101 "\"location\":{\"type\":\"Location\"," |
102 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}", | 102 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}", |
103 handler.msg()); | 103 handler.msg()); |
104 | 104 |
105 // Missing sub-command. | 105 // Missing sub-command. |
106 service_msg = Eval(lib, "[port, ['debug'], [], []]"); | 106 service_msg = Eval(lib, "[port, ['debug'], [], []]"); |
107 Service::HandleServiceMessage(isolate, service_msg); | 107 Service::HandleServiceMessage(isolate, service_msg); |
108 handler.HandleNextMessage(); | 108 handler.HandleNextMessage(); |
109 EXPECT_STREQ( | 109 EXPECT_STREQ( |
110 "{\"type\":\"Error\"," | 110 "{\"type\":\"Error\"," |
111 "\"text\":\"Must specify a subcommand\"," | 111 "\"text\":\"Must specify a subcommand\"," |
(...skipping 28 matching lines...) Expand all Loading... |
140 Service::HandleServiceMessage(isolate, service_msg); | 140 Service::HandleServiceMessage(isolate, service_msg); |
141 handler.HandleNextMessage(); | 141 handler.HandleNextMessage(); |
142 EXPECT_STREQ("{\"type\":\"Error\"," | 142 EXPECT_STREQ("{\"type\":\"Error\"," |
143 "\"text\":\"Unrecognized subcommand 'nosferatu'\"," | 143 "\"text\":\"Unrecognized subcommand 'nosferatu'\"," |
144 "\"message\":{\"arguments\":[\"debug\",\"nosferatu\"]," | 144 "\"message\":{\"arguments\":[\"debug\",\"nosferatu\"]," |
145 "\"option_keys\":[],\"option_values\":[]}}", | 145 "\"option_keys\":[],\"option_values\":[]}}", |
146 handler.msg()); | 146 handler.msg()); |
147 } | 147 } |
148 | 148 |
149 } // namespace dart | 149 } // namespace dart |
OLD | NEW |