Index: runtime/vm/debugger_api_impl_test.cc |
=================================================================== |
--- runtime/vm/debugger_api_impl_test.cc (revision 23040) |
+++ runtime/vm/debugger_api_impl_test.cc (working copy) |
@@ -958,87 +958,6 @@ |
} |
-TEST_CASE(Debug_LookupSourceLine) { |
- const char* kScriptChars = |
- /*1*/ "class A { \n" |
- /*2*/ " static void foo() { \n" |
- /*3*/ " moo('good news'); \n" |
- /*4*/ " } \n" |
- /*5*/ "} \n" |
- /*6*/ " \n" |
- /*7*/ "void main() { \n" |
- /*8*/ " A.foo(); \n" |
- /*9*/ "} \n" |
- /*10*/ " \n"; |
- |
- LoadScript(kScriptChars); |
- |
- const Library& test_lib = |
- Library::CheckedHandle(Api::UnwrapHandle(script_lib)); |
- const String& script_url = String::Handle(String::New(TestCase::url())); |
- Function& func = Function::Handle(); |
- |
- for (int line = 7; line <= 9; line++) { |
- func = test_lib.LookupFunctionInSource(script_url, line); |
- EXPECT(!func.IsNull()); |
- EXPECT_STREQ("main", String::Handle(func.name()).ToCString()); |
- } |
- |
- for (int line = 2; line <= 4; line++) { |
- func = test_lib.LookupFunctionInSource(script_url, 3); |
- EXPECT(!func.IsNull()); |
- EXPECT_STREQ("foo", String::Handle(func.name()).ToCString()); |
- } |
- |
- // The VM generates an implicit constructor for class A and |
- // locates it at the token position of the keyword 'class'. |
- func = test_lib.LookupFunctionInSource(script_url, 1); |
- EXPECT(!func.IsNull()); |
- EXPECT_STREQ("A.", String::Handle(func.name()).ToCString()); |
- |
- func = test_lib.LookupFunctionInSource(script_url, 6); |
- EXPECT(func.IsNull()); |
- func = test_lib.LookupFunctionInSource(script_url, 10); |
- EXPECT(func.IsNull()); |
- |
- Dart_Handle libs = Dart_GetLibraryIds(); |
- EXPECT(Dart_IsList(libs)); |
- intptr_t num_libs; |
- Dart_ListLength(libs, &num_libs); |
- EXPECT(num_libs > 0); |
- for (int i = 0; i < num_libs; i++) { |
- Dart_Handle lib_id = Dart_ListGetAt(libs, i); |
- EXPECT(Dart_IsInteger(lib_id)); |
- int64_t id = 0; |
- Dart_IntegerToInt64(lib_id, &id); |
- Dart_Handle lib_url = Dart_GetLibraryURL(id); |
- char const* chars; |
- Dart_StringToCString(lib_url, &chars); |
- OS::Print("Lib %d: %s\n", i, chars); |
- |
- Dart_Handle scripts = Dart_GetScriptURLs(lib_url); |
- EXPECT(Dart_IsList(scripts)); |
- intptr_t num_scripts; |
- Dart_ListLength(scripts, &num_scripts); |
- EXPECT(num_scripts >= 0); |
- for (int i = 0; i < num_scripts; i++) { |
- Dart_Handle script_url = Dart_ListGetAt(scripts, i); |
- char const* chars; |
- Dart_StringToCString(script_url, &chars); |
- OS::Print(" script %d: '%s'\n", i + 1, chars); |
- } |
- } |
- |
- Dart_Handle lib_url = NewString(TestCase::url()); |
- Dart_Handle source = Dart_ScriptGetSource((num_libs - 1), lib_url); |
- EXPECT(Dart_IsString(source)); |
- char const* source_chars; |
- Dart_StringToCString(source, &source_chars); |
- OS::Print("\n=== source: ===\n%s", source_chars); |
- EXPECT_STREQ(kScriptChars, source_chars); |
-} |
- |
- |
static Dart_IsolateId test_isolate_id = ILLEGAL_ISOLATE_ID; |
static int verify_callback = 0; |
static void TestIsolateID(Dart_IsolateId isolate_id, Dart_IsolateEvent kind) { |