Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: runtime/vm/service_test.cc

Issue 117133005: Change how debugger handles source breakpoints (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | tests/standalone/debugger/breakpoint_resolved_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 isolate->debugger()->SetBreakpointAtLine(url, 3); 132 isolate->debugger()->SetBreakpointAtLine(url, 3);
133 133
134 // Get the breakpoint list. 134 // Get the breakpoint list.
135 service_msg = Eval(lib, "[port, ['debug', 'breakpoints'], [], []]"); 135 service_msg = Eval(lib, "[port, ['debug', 'breakpoints'], [], []]");
136 Service::HandleServiceMessage(isolate, service_msg); 136 Service::HandleServiceMessage(isolate, service_msg);
137 handler.HandleNextMessage(); 137 handler.HandleNextMessage();
138 EXPECT_STREQ( 138 EXPECT_STREQ(
139 "{\"type\":\"BreakpointList\",\"breakpoints\":[{" 139 "{\"type\":\"BreakpointList\",\"breakpoints\":[{"
140 "\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true," 140 "\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true,"
141 "\"resolved\":false," 141 "\"resolved\":false,"
142 "\"location\":{\"type\":\"Location\",\"libId\":12," 142 "\"location\":{\"type\":\"Location\","
143 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}]}", 143 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}]}",
144 handler.msg()); 144 handler.msg());
145 145
146 // Individual breakpoint. 146 // Individual breakpoint.
147 service_msg = Eval(lib, "[port, ['debug', 'breakpoints', '1'], [], []]"); 147 service_msg = Eval(lib, "[port, ['debug', 'breakpoints', '1'], [], []]");
148 Service::HandleServiceMessage(isolate, service_msg); 148 Service::HandleServiceMessage(isolate, service_msg);
149 handler.HandleNextMessage(); 149 handler.HandleNextMessage();
150 EXPECT_STREQ( 150 EXPECT_STREQ(
151 "{\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true," 151 "{\"type\":\"Breakpoint\",\"id\":1,\"enabled\":true,"
152 "\"resolved\":false," 152 "\"resolved\":false,"
153 "\"location\":{\"type\":\"Location\",\"libId\":12," 153 "\"location\":{\"type\":\"Location\","
154 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}", 154 "\"script\":\"dart:test-lib\",\"tokenPos\":5}}",
155 handler.msg()); 155 handler.msg());
156 156
157 // Missing sub-command. 157 // Missing sub-command.
158 service_msg = Eval(lib, "[port, ['debug'], [], []]"); 158 service_msg = Eval(lib, "[port, ['debug'], [], []]");
159 Service::HandleServiceMessage(isolate, service_msg); 159 Service::HandleServiceMessage(isolate, service_msg);
160 handler.HandleNextMessage(); 160 handler.HandleNextMessage();
161 EXPECT_STREQ( 161 EXPECT_STREQ(
162 "{\"type\":\"Error\"," 162 "{\"type\":\"Error\","
163 "\"text\":\"Must specify a subcommand\"," 163 "\"text\":\"Must specify a subcommand\","
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 Service::HandleServiceMessage(isolate, service_msg); 352 Service::HandleServiceMessage(isolate, service_msg);
353 handler.HandleNextMessage(); 353 handler.HandleNextMessage();
354 EXPECT_STREQ( 354 EXPECT_STREQ(
355 "{\"type\":\"Error\",\"text\":\"Command too long\",\"message\":" 355 "{\"type\":\"Error\",\"text\":\"Command too long\",\"message\":"
356 "{\"arguments\":[\"classes\",\"1009\",\"functions\",\"9\",\"x\"]," 356 "{\"arguments\":[\"classes\",\"1009\",\"functions\",\"9\",\"x\"],"
357 "\"option_keys\":[],\"option_values\":[]}}", 357 "\"option_keys\":[],\"option_values\":[]}}",
358 handler.msg()); 358 handler.msg());
359 } 359 }
360 360
361 } // namespace dart 361 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | tests/standalone/debugger/breakpoint_resolved_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698