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

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

Issue 113513004: Handle vmservice messages while at breakpoint. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/debugger_api_impl_test.cc ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "vm/debugger.h"
6 #include "vm/unit_test.h"
7
8 namespace dart {
9
10 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) {
11 const char* kScriptChars =
12 "void main() {\n"
13 " print('won');\n"
14 " print('too');\n"
15 " print('free');\n"
16 " print('for');\n"
17 "}\n";
18 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
19 EXPECT_VALID(lib);
20
21 Isolate* isolate = Isolate::Current();
22 Debugger* debugger = isolate->debugger();
23 const String& url = String::Handle(String::New(TestCase::url()));
24
25 // Empty case.
26 {
27 JSONStream js;
28 {
29 JSONArray jsarr(&js);
30 debugger->PrintBreakpointsToJSONArray(&jsarr);
31 }
32 EXPECT_STREQ("[]", js.ToCString());
33 }
34
35 // Test with a couple of breakpoints.
36 debugger->SetBreakpointAtLine(url, 2);
37 debugger->SetBreakpointAtLine(url, 3);
38 {
39 JSONStream js;
40 {
41 JSONArray jsarr(&js);
42 debugger->PrintBreakpointsToJSONArray(&jsarr);
43 }
44 EXPECT_STREQ(
45 "[{\"type\":\"Breakpoint\",\"id\":2,"
46 "\"enabled\":true,\"resolved\":false,"
47 "\"location\":{\"type\":\"Location\",\"libId\":12,"
48 "\"script\":\"dart:test-lib\",\"tokenPos\":12}},"
49 "{\"type\":\"Breakpoint\",\"id\":1,"
50 "\"enabled\":true,\"resolved\":false,"
51 "\"location\":{\"type\":\"Location\",\"libId\":12,"
52 "\"script\":\"dart:test-lib\",\"tokenPos\":6}}]",
53 js.ToCString());
54 }
55 }
56
57 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698