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/debugger.h" | 5 #include "vm/debugger.h" |
6 #include "vm/unit_test.h" | 6 #include "vm/unit_test.h" |
7 | 7 |
8 namespace dart { | 8 namespace dart { |
9 | 9 |
10 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) { | 10 TEST_CASE(Debugger_PrintBreakpointsToJSONArray) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 static bool saw_paused_event = false; | 58 static bool saw_paused_event = false; |
59 | 59 |
60 static void InspectPausedEvent(Dart_IsolateId isolate_id, | 60 static void InspectPausedEvent(Dart_IsolateId isolate_id, |
61 intptr_t bp_id, | 61 intptr_t bp_id, |
62 const Dart_CodeLocation& loc) { | 62 const Dart_CodeLocation& loc) { |
63 Isolate* isolate = Isolate::Current(); | 63 Isolate* isolate = Isolate::Current(); |
64 Debugger* debugger = isolate->debugger(); | 64 Debugger* debugger = isolate->debugger(); |
65 | 65 |
66 // The debugger knows that it is paused, and why. | 66 // The debugger knows that it is paused, and why. |
67 EXPECT(debugger->IsPaused()); | 67 EXPECT(debugger->IsPaused()); |
68 const Debugger::DebuggerEvent* event = debugger->PauseEvent(); | 68 const DebuggerEvent* event = debugger->PauseEvent(); |
69 EXPECT(event != NULL); | 69 EXPECT(event != NULL); |
70 EXPECT(event->type == Debugger::kBreakpointReached); | 70 EXPECT(event->type() == DebuggerEvent::kBreakpointReached); |
71 saw_paused_event = true; | 71 saw_paused_event = true; |
72 } | 72 } |
73 | 73 |
74 | 74 |
75 TEST_CASE(Debugger_PauseEvent) { | 75 TEST_CASE(Debugger_PauseEvent) { |
76 const char* kScriptChars = | 76 const char* kScriptChars = |
77 "main() {\n" | 77 "main() {\n" |
78 " var x = new StringBuffer();\n" | 78 " var x = new StringBuffer();\n" |
79 " x.write('won');\n" | 79 " x.write('won');\n" |
80 " x.write('too');\n" | 80 " x.write('too');\n" |
(...skipping 17 matching lines...) Expand all Loading... |
98 debugger->SetBreakpointAtLine(url, 2); | 98 debugger->SetBreakpointAtLine(url, 2); |
99 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 99 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
100 EXPECT_VALID(result); | 100 EXPECT_VALID(result); |
101 EXPECT(Dart_IsString(result)); | 101 EXPECT(Dart_IsString(result)); |
102 | 102 |
103 // We ran the code in InspectPausedEvent. | 103 // We ran the code in InspectPausedEvent. |
104 EXPECT(saw_paused_event); | 104 EXPECT(saw_paused_event); |
105 } | 105 } |
106 | 106 |
107 } // namespace dart | 107 } // namespace dart |
OLD | NEW |