Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: runtime/vm/debugger_test.cc

Issue 2965673004: Fix setting breakpoints in parts of a library. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger_test.cc
diff --git a/runtime/vm/debugger_test.cc b/runtime/vm/debugger_test.cc
index 70fc140c1b292951227c9fc1606c5adcb0ad5b83..842d0234f317a8439e4b8b78257c5cadbcfb827b 100644
--- a/runtime/vm/debugger_test.cc
+++ b/runtime/vm/debugger_test.cc
@@ -80,6 +80,37 @@ static void PausedInClosuresHandler(Dart_IsolateId isolate_id,
closure_hit_count++;
}
+TEST_CASE(Debugger_SetBreakpointInPartOfLibrary) {
+ const char* kMainScript = "main() {}\n";
+ const char* kLib = "library test_lib;\n";
+ const char* kLibPart =
+ "part of test_lib;\n"
+ "void func(int a, int b) {\n"
+ " return a + b;\n"
+ "}\n";
+ SetFlagScope<bool> sfs(&FLAG_remove_script_timestamps_for_test, true);
+ Dart_Handle root_lib = TestCase::LoadTestScript(kMainScript, NULL);
+ EXPECT_VALID(root_lib);
+
+ Dart_Handle url = NewString("test_lib_url");
+ Dart_Handle lib_source = NewString(kLib);
+ Dart_Handle lib = Dart_LoadLibrary(url, Dart_Null(), lib_source, 0, 0);
+ EXPECT_VALID(lib);
+ EXPECT(Dart_IsLibrary(lib));
+
+ Dart_Handle part_url = NewString("part_url");
+ Dart_Handle part_source = NewString(kLibPart);
+ Dart_Handle result =
+ Dart_LoadSource(lib, part_url, Dart_Null(), part_source, 0, 0);
+ EXPECT_VALID(result);
+ EXPECT(Dart_IsLibrary(result));
+ EXPECT(Dart_IdentityEquals(lib, result));
+
+ result = Dart_SetBreakpoint(part_url, 3);
+ EXPECT_VALID(result);
+ EXPECT(Dart_IsInteger(result));
+}
+
TEST_CASE(Debugger_SetBreakpointInFunctionLiteralFieldInitializers) {
const char* kScriptChars =
"main() {\n"
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698