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

Unified Diff: runtime/vm/service_test.cc

Issue 217323006: Redo allocationprofile options (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
index 1bc8f66f4adc4bae81dfcf1a44a32a63d2f22f4e..bb326aa447c66076045e078d9ca374f3ef522801 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -1114,6 +1114,45 @@ TEST_CASE(Service_AllocationProfile) {
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
+
+ // Too long.
+ service_msg = Eval(h_lib, "[port, ['allocationprofile', 'foo'], [], []]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
+
+ // Bad gc option.
+ service_msg = Eval(h_lib, "[port, ['allocationprofile'], ['gc'], ['cat']]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
+
+ // Bad reset option.
+ service_msg = Eval(h_lib, "[port, ['allocationprofile'], ['reset'], ['ff']]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
+
+ // Good reset.
+ service_msg =
+ Eval(h_lib, "[port, ['allocationprofile'], ['reset'], ['true']]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
+
+ // Good GC.
+ service_msg =
+ Eval(h_lib, "[port, ['allocationprofile'], ['gc'], ['full']]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
+
+ // Good GC and reset.
+ service_msg = Eval(h_lib,
+ "[port, ['allocationprofile'], ['gc', 'reset'], ['full', 'true']]");
+ Service::HandleIsolateMessage(isolate, service_msg);
+ handler.HandleNextMessage();
+ EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
}
« 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