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

Unified Diff: runtime/vm/debugger_api_impl_test.cc

Issue 10383164: Debugger wire protocol: setting breakpoints (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/debugger_api_impl_test.cc
===================================================================
--- runtime/vm/debugger_api_impl_test.cc (revision 7627)
+++ runtime/vm/debugger_api_impl_test.cc (working copy)
@@ -611,10 +611,10 @@
Dart_SetBreakpointHandler(&ExprClosureBreakpointHandler);
Dart_Handle script_url = Dart_NewString(TestCase::url());
- Dart_Handle line_no = Dart_NewInteger(5); // In closure 'add'.
- Dart_Breakpoint bpt;
- Dart_Handle res = Dart_SetBreakpointAtLine(script_url, line_no, &bpt);
+ intptr_t line_no = 5; // In closure 'add'.
+ Dart_Handle res = Dart_SetBreakpoint(script_url, line_no);
EXPECT_NOT_ERROR(res);
+ EXPECT(Dart_IsInteger(res));
breakpoint_hit_counter = 0;
Dart_Handle retval = Invoke("main");
@@ -626,6 +626,8 @@
}
+static intptr_t bp_id_to_be_deleted;
+
static void DeleteBreakpointHandler(Dart_Breakpoint bpt,
Dart_StackTrace trace) {
const char* expected_trace[] = {"foo", "main"};
@@ -651,7 +653,7 @@
// Remove the breakpoint after we've hit it twice
if (breakpoint_hit_counter == 2) {
if (verbose) OS::Print("uninstalling breakpoint\n");
- Dart_Handle res = Dart_DeleteBreakpoint(bpt);
+ Dart_Handle res = Dart_RemoveBreakpoint(bp_id_to_be_deleted);
EXPECT_NOT_ERROR(res);
}
}
@@ -674,17 +676,20 @@
LoadScript(kScriptChars);
Dart_Handle script_url = Dart_NewString(TestCase::url());
- Dart_Handle line_no = Dart_NewInteger(4); // In function 'foo'.
+ intptr_t line_no = 4; // In function 'foo'.
Dart_SetBreakpointHandler(&DeleteBreakpointHandler);
- Dart_Breakpoint bpt;
- Dart_Handle res = Dart_SetBreakpointAtLine(script_url, line_no, &bpt);
+ Dart_Handle res = Dart_SetBreakpoint(script_url, line_no);
EXPECT_NOT_ERROR(res);
+ EXPECT(Dart_IsInteger(res));
+ int64_t bp_id = 0;
+ Dart_IntegerToInt64(res, &bp_id);
// Function main() calls foo() 3 times. On the second iteration, the
// breakpoint is removed by the handler, so we expect the breakpoint
// to fire twice only.
+ bp_id_to_be_deleted = bp_id;
breakpoint_hit_counter = 0;
Dart_Handle retval = Invoke("main");
EXPECT(!Dart_IsError(retval));
« lib/json/json.dart ('K') | « runtime/vm/debugger_api_impl.cc ('k') | tools/ddbg.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698