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

Unified Diff: runtime/vm/service_test.cc

Issue 266323002: Class view: Retained size of all instances. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 35762)
+++ runtime/vm/service_test.cc (working copy)
@@ -637,10 +637,12 @@
" return d;\n"
" }\n"
"}\n"
+ "class B { static int i = 42; }\n"
"main() {\n"
" var z = new A();\n"
" var x = z.c();\n"
" x();\n"
+ " ++B.i;\n"
"}";
Isolate* isolate = Isolate::Current();
@@ -770,6 +772,19 @@
"\"request\":"
"{\"arguments\":[\"classes\",\"%" Pd "\",\"functions\",\"9\",\"x\"],"
"\"option_keys\":[],\"option_values\":[]}}", cid);
+
+ // Retained size of all instances of class B.
+ const Class& class_b = Class::Handle(GetClass(lib, "B"));
+ EXPECT(!class_b.IsNull());
+ const Instance& b0 = Instance::Handle(Instance::New(class_b));
+ const Instance& b1 = Instance::Handle(Instance::New(class_b));
+ service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'retained'],"
+ "[], []]", class_b.id());
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ ExpectSubstringF(handler.msg(),
+ "\"id\":\"objects\\/int-%" Pd "\"",
+ b0.raw()->Size() + b1.raw()->Size());
}
« 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