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

Unified Diff: runtime/vm/service_test.cc

Issue 340673002: VM service: List all instances of a class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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/service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_test.cc
===================================================================
--- runtime/vm/service_test.cc (revision 37413)
+++ runtime/vm/service_test.cc (working copy)
@@ -836,6 +836,22 @@
ExpectSubstringF(handler.msg(),
"\"id\":\"objects\\/int-%" Pd "\"",
b0.raw()->Size() + b1.raw()->Size());
+ // ... and list the instances of class B.
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'instances'],"
+ "['limit'], ['3']]", class_b.id());
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ ExpectSubstringF(handler.msg(), "\"type\":\"@Array\"");
+ // TODO(koda): Actually parse the response.
+ static const intptr_t kInstanceListId = 0;
+ ExpectSubstringF(handler.msg(), "\"id\":\"objects\\/%" Pd "\",\"length\":2",
+ kInstanceListId);
+ Array& list = Array::Handle();
+ list ^= isolate->object_id_ring()->GetObjectForId(kInstanceListId);
+ EXPECT_EQ(2, list.Length());
Cutch 2014/06/18 17:23:07 Might be good idea to have a test which verifies t
koda 2014/06/18 20:55:32 Done.
+ // The list should contain {b0, b1}.
+ EXPECT((list.At(0) == b0.raw() && list.At(1) == b1.raw()) ||
+ (list.At(0) == b1.raw() && list.At(1) == b0.raw()));
}
« no previous file with comments | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698