Chromium Code Reviews| Index: runtime/vm/debugger_test.cc |
| diff --git a/runtime/vm/debugger_test.cc b/runtime/vm/debugger_test.cc |
| index 8963195085e74d01175739853ea99276dd2cade9..86792f04667e8069d61b474fcd552009f44f26f4 100644 |
| --- a/runtime/vm/debugger_test.cc |
| +++ b/runtime/vm/debugger_test.cc |
| @@ -71,6 +71,45 @@ TEST_CASE(Debugger_GetBreakpointsById) { |
| EXPECT(debugger->GetBreakpointById(bp_id2) != NULL); |
| } |
| +TEST_CASE(Debugger_SetBreakpointInFunctionLiteralFieldInitializers) { |
| + const char* kScriptChars = |
| + "main() {\n" |
| + " var c = new MyClass();\n" |
| + " c.closure(1, 2);\n" |
| + " closure(3, 4);\n" |
| + "}\n" |
| + "class MyClass {\n" |
| + " var closure = (int a, int b) {\n" |
| + " return a + b;\n" |
| + " };\n" |
| + "}\n" |
| + "var closure = (int a, int b) {\n" |
| + " return a + b;\n" |
| + "};\n"; |
|
siva
2017/05/24 19:51:23
Can we add more tests
1. => function tests e.g var
sivachandra
2017/05/26 07:17:58
Done.
|
| + SetFlagScope<bool> sfs(&FLAG_remove_script_timestamps_for_test, true); |
| + Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
| + EXPECT_VALID(lib); |
| + |
| + Isolate* isolate = Isolate::Current(); |
| + Debugger* debugger = isolate->debugger(); |
| + |
| + Dart_Handle url = NewString(TestCase::url()); |
| + Dart_Handle result = Dart_SetBreakpoint(url, 8); |
| + EXPECT_VALID(result); |
| + EXPECT(Dart_IsInteger(result)); |
| + int64_t bp_id1 = 0; |
| + EXPECT_VALID(Dart_IntegerToInt64(result, &bp_id1)); |
| + |
| + result = Dart_SetBreakpoint(url, 12); |
| + EXPECT_VALID(result); |
| + EXPECT(Dart_IsInteger(result)); |
| + int64_t bp_id2 = 0; |
| + EXPECT_VALID(Dart_IntegerToInt64(result, &bp_id2)); |
| + |
| + EXPECT(debugger->GetBreakpointById(bp_id1) != NULL); |
| + EXPECT(debugger->GetBreakpointById(bp_id2) != NULL); |
|
siva
2017/05/24 19:51:23
Should test if the breakpoint is actually hit by r
sivachandra
2017/05/26 07:17:58
Done.
|
| +} |
| + |
| TEST_CASE(Debugger_RemoveBreakpoint) { |
| const char* kScriptChars = |
| "main() {\n" |