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

Unified Diff: runtime/vm/debugger_api_impl_test.cc

Issue 65383007: Add Dart_GetClosureInfo (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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_api_impl.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_api_impl_test.cc
===================================================================
--- runtime/vm/debugger_api_impl_test.cc (revision 30160)
+++ runtime/vm/debugger_api_impl_test.cc (working copy)
@@ -1875,6 +1875,36 @@
}
+TEST_CASE(Debug_GetClosureInfo) {
+ const char* kScriptChars =
+ "void foo() { return 43; } \n"
+ " \n"
+ "main() { \n"
+ " return foo; \n"
+ "} \n";
+
+ LoadScript(kScriptChars);
+ Dart_Handle clo = Invoke("main");
+ EXPECT_VALID(clo);
+ EXPECT(Dart_IsClosure(clo));
+ Dart_Handle name;
+ Dart_CodeLocation loc;
+ loc.script_url = Dart_Null();
+ loc.library_id = -1;
+ loc.token_pos = -1;
+ Dart_Handle res = Dart_GetClosureInfo(clo, &name, &loc);
+ EXPECT_VALID(res);
+ EXPECT_TRUE(res);
+ EXPECT_VALID(name);
+ EXPECT(Dart_IsString(name));
+ EXPECT_STREQ("foo", ToCString(name));
+ EXPECT(Dart_IsString(loc.script_url));
+ EXPECT_STREQ("dart:test-lib", ToCString(loc.script_url));
+ EXPECT_EQ(0, loc.token_pos);
+ EXPECT(loc.library_id > 0);
+}
+
+
TEST_CASE(Debug_GetSupertype) {
const char* kScriptChars =
"class Test {\n"
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698