| 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/dart_api_impl.h" | 5 #include "vm/dart_api_impl.h" | 
| 6 #include "vm/debugger.h" | 6 #include "vm/debugger.h" | 
| 7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" | 
| 8 | 8 | 
| 9 namespace dart { | 9 namespace dart { | 
| 10 | 10 | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 62   { | 62   { | 
| 63     JSONStream js; | 63     JSONStream js; | 
| 64     { | 64     { | 
| 65       JSONArray jsarr(&js); | 65       JSONArray jsarr(&js); | 
| 66       debugger->PrintBreakpointsToJSONArray(&jsarr); | 66       debugger->PrintBreakpointsToJSONArray(&jsarr); | 
| 67     } | 67     } | 
| 68     ExpectSubstringF( | 68     ExpectSubstringF( | 
| 69         js.ToCString(), | 69         js.ToCString(), | 
| 70         "[{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/2\"," | 70         "[{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/2\"," | 
| 71         "\"breakpointNumber\":2,\"resolved\":false," | 71         "\"breakpointNumber\":2,\"resolved\":false," | 
| 72         "\"location\":{\"type\":\"SourceLocation\"," | 72         "\"location\":{\"type\":\"UnresolvedSourceLocation\"," | 
| 73         "\"script\":{\"type\":\"@Script\",\"fixedId\":true," | 73         "\"script\":{\"type\":\"@Script\",\"fixedId\":true," | 
| 74         "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\"," | 74         "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\"," | 
| 75         "\"uri\":\"test-lib\"," | 75         "\"uri\":\"test-lib\"," | 
| 76         "\"_kind\":\"script\"},\"tokenPos\":14}}," | 76         "\"_kind\":\"script\"},\"line\":3}}," | 
| 77         "{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/1\"," | 77         "{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/1\"," | 
| 78         "\"breakpointNumber\":1,\"resolved\":false," | 78         "\"breakpointNumber\":1,\"resolved\":false," | 
| 79         "\"location\":{\"type\":\"SourceLocation\"," | 79         "\"location\":{\"type\":\"UnresolvedSourceLocation\"," | 
| 80         "\"script\":{\"type\":\"@Script\",\"fixedId\":true," | 80         "\"script\":{\"type\":\"@Script\",\"fixedId\":true," | 
| 81         "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\"," | 81         "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\"," | 
| 82         "\"uri\":\"test-lib\"," | 82         "\"uri\":\"test-lib\"," | 
| 83         "\"_kind\":\"script\"},\"tokenPos\":5}}]", | 83         "\"_kind\":\"script\"},\"line\":2}}]", | 
| 84         vmlib.index(), vmlib.index()); | 84         vmlib.index(), vmlib.index()); | 
| 85   } | 85   } | 
| 86 } | 86 } | 
| 87 | 87 | 
| 88 | 88 | 
| 89 static bool saw_paused_event = false; | 89 static bool saw_paused_event = false; | 
| 90 | 90 | 
| 91 static void InspectPausedEvent(Dart_IsolateId isolate_id, | 91 static void InspectPausedEvent(Dart_IsolateId isolate_id, | 
| 92                                intptr_t bp_id, | 92                                intptr_t bp_id, | 
| 93                                const Dart_CodeLocation& loc) { | 93                                const Dart_CodeLocation& loc) { | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 129   debugger->SetBreakpointAtLine(url, 2); | 129   debugger->SetBreakpointAtLine(url, 2); | 
| 130   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 130   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 
| 131   EXPECT_VALID(result); | 131   EXPECT_VALID(result); | 
| 132   EXPECT(Dart_IsString(result)); | 132   EXPECT(Dart_IsString(result)); | 
| 133 | 133 | 
| 134   // We ran the code in InspectPausedEvent. | 134   // We ran the code in InspectPausedEvent. | 
| 135   EXPECT(saw_paused_event); | 135   EXPECT(saw_paused_event); | 
| 136 } | 136 } | 
| 137 | 137 | 
| 138 }  // namespace dart | 138 }  // namespace dart | 
| OLD | NEW | 
|---|