| 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/dart_api_message.h" | 6 #include "vm/dart_api_message.h" |
| 7 #include "vm/debugger.h" | 7 #include "vm/debugger.h" |
| 8 #include "vm/message.h" | 8 #include "vm/message.h" |
| 9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 EXPECT_ERROR(result, "could not set breakpoint at line 20"); | 134 EXPECT_ERROR(result, "could not set breakpoint at line 20"); |
| 135 | 135 |
| 136 EXPECT(debugger->GetBreakpointById(closure_bp_id[0]) != NULL); | 136 EXPECT(debugger->GetBreakpointById(closure_bp_id[0]) != NULL); |
| 137 EXPECT(debugger->GetBreakpointById(closure_bp_id[1]) != NULL); | 137 EXPECT(debugger->GetBreakpointById(closure_bp_id[1]) != NULL); |
| 138 EXPECT(debugger->GetBreakpointById(closure_bp_id[2]) != NULL); | 138 EXPECT(debugger->GetBreakpointById(closure_bp_id[2]) != NULL); |
| 139 EXPECT(debugger->GetBreakpointById(closure_bp_id[3]) != NULL); | 139 EXPECT(debugger->GetBreakpointById(closure_bp_id[3]) != NULL); |
| 140 | 140 |
| 141 Dart_SetPausedEventHandler(PausedInClosuresHandler); | 141 Dart_SetPausedEventHandler(PausedInClosuresHandler); |
| 142 result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 142 result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
| 143 EXPECT_VALID(result); | 143 EXPECT_VALID(result); |
| 144 // TODO(sivachandra): Understand why a breakpoint on a single line | 144 EXPECT(closure_hit_count == 4); |
| 145 // functional literal is not being hit. When that issue is resolved, | |
| 146 // adjust this test to check hitting the breakpoint at line 19 also. | |
| 147 EXPECT(closure_hit_count == 3); | |
| 148 } | 145 } |
| 149 | 146 |
| 150 TEST_CASE(Debugger_RemoveBreakpoint) { | 147 TEST_CASE(Debugger_RemoveBreakpoint) { |
| 151 const char* kScriptChars = | 148 const char* kScriptChars = |
| 152 "main() {\n" | 149 "main() {\n" |
| 153 " var x = new StringBuffer();\n" | 150 " var x = new StringBuffer();\n" |
| 154 " x.add('won');\n" | 151 " x.add('won');\n" |
| 155 " x.add('too');\n" | 152 " x.add('too');\n" |
| 156 " return x.toString();\n" | 153 " return x.toString();\n" |
| 157 "}\n"; | 154 "}\n"; |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 "enter(bar1) enter(bar2) enter(bar3) enter(foo) " | 577 "enter(bar1) enter(bar2) enter(bar3) enter(foo) " |
| 581 "enter(bar3) enter(foo) " | 578 "enter(bar3) enter(foo) " |
| 582 "exit(foo) exit(bar3) exit(bar2) exit(bar1) ", | 579 "exit(foo) exit(bar3) exit(bar2) exit(bar1) ", |
| 583 result_cstr); | 580 result_cstr); |
| 584 EXPECT(saw_paused_event); | 581 EXPECT(saw_paused_event); |
| 585 } | 582 } |
| 586 | 583 |
| 587 #endif // !PRODUCT | 584 #endif // !PRODUCT |
| 588 | 585 |
| 589 } // namespace dart | 586 } // namespace dart |
| OLD | NEW |