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 // TODO(zra): Remove when tests are ready to enable. | 5 // TODO(zra): Remove when tests are ready to enable. |
6 #include "platform/globals.h" | 6 #include "platform/globals.h" |
7 #if !defined(TARGET_ARCH_ARM64) | 7 #if !defined(TARGET_ARCH_ARM64) |
8 | 8 |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 static bool saw_paused_event = false; | 62 static bool saw_paused_event = false; |
63 | 63 |
64 static void InspectPausedEvent(Dart_IsolateId isolate_id, | 64 static void InspectPausedEvent(Dart_IsolateId isolate_id, |
65 intptr_t bp_id, | 65 intptr_t bp_id, |
66 const Dart_CodeLocation& loc) { | 66 const Dart_CodeLocation& loc) { |
67 Isolate* isolate = Isolate::Current(); | 67 Isolate* isolate = Isolate::Current(); |
68 Debugger* debugger = isolate->debugger(); | 68 Debugger* debugger = isolate->debugger(); |
69 | 69 |
70 // The debugger knows that it is paused, and why. | 70 // The debugger knows that it is paused, and why. |
71 EXPECT(debugger->IsPaused()); | 71 EXPECT(debugger->IsPaused()); |
72 const Debugger::DebuggerEvent* event = debugger->PauseEvent(); | 72 const DebuggerEvent* event = debugger->PauseEvent(); |
73 EXPECT(event != NULL); | 73 EXPECT(event != NULL); |
74 EXPECT(event->type == Debugger::kBreakpointReached); | 74 EXPECT(event->type() == DebuggerEvent::kBreakpointReached); |
75 saw_paused_event = true; | 75 saw_paused_event = true; |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 TEST_CASE(Debugger_PauseEvent) { | 79 TEST_CASE(Debugger_PauseEvent) { |
80 const char* kScriptChars = | 80 const char* kScriptChars = |
81 "main() {\n" | 81 "main() {\n" |
82 " var x = new StringBuffer();\n" | 82 " var x = new StringBuffer();\n" |
83 " x.write('won');\n" | 83 " x.write('won');\n" |
84 " x.write('too');\n" | 84 " x.write('too');\n" |
(...skipping 19 matching lines...) Expand all Loading... |
104 EXPECT_VALID(result); | 104 EXPECT_VALID(result); |
105 EXPECT(Dart_IsString(result)); | 105 EXPECT(Dart_IsString(result)); |
106 | 106 |
107 // We ran the code in InspectPausedEvent. | 107 // We ran the code in InspectPausedEvent. |
108 EXPECT(saw_paused_event); | 108 EXPECT(saw_paused_event); |
109 } | 109 } |
110 | 110 |
111 } // namespace dart | 111 } // namespace dart |
112 | 112 |
113 #endif // !defined(TARGET_ARCH_ARM64) | 113 #endif // !defined(TARGET_ARCH_ARM64) |
OLD | NEW |