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

Unified Diff: runtime/vm/service_test.cc

Issue 300223011: - Add possibility to redirect messages if they were not delivered. (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/message.dart ('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 36729)
+++ runtime/vm/service_test.cc (working copy)
@@ -90,11 +90,20 @@
static RawInstance* Eval(Dart_Handle lib, const char* expr) {
- Dart_Handle result = Dart_EvaluateExpr(lib, NewString(expr));
- EXPECT_VALID(result);
+ Dart_Handle expr_val = Dart_EvaluateExpr(lib, NewString(expr));
+ EXPECT_VALID(expr_val);
Isolate* isolate = Isolate::Current();
- const Instance& instance = Api::UnwrapInstanceHandle(isolate, result);
- return instance.raw();
+ const GrowableObjectArray& value =
+ Api::UnwrapGrowableObjectArrayHandle(isolate, expr_val);
+ const Array& result = Array::Handle(Array::MakeArray(value));
+ GrowableObjectArray& growable = GrowableObjectArray::Handle();
+ growable ^= result.At(3);
+ Array& array = Array::Handle(Array::MakeArray(growable));
+ result.SetAt(3, array);
+ growable ^= result.At(4);
+ array = Array::MakeArray(growable);
+ result.SetAt(4, array);
+ return result.raw();
}
@@ -175,7 +184,7 @@
Instance& service_msg = Instance::Handle();
// Get the isolate summary.
- service_msg = Eval(lib, "[port, [], [], []]");
+ service_msg = Eval(lib, "[0, port, [], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -230,7 +239,7 @@
Instance& service_msg = Instance::Handle();
// Get the stacktrace.
- service_msg = Eval(lib, "[port, ['stacktrace'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['stacktrace'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -238,7 +247,7 @@
handler.msg());
// Malformed request.
- service_msg = Eval(lib, "[port, ['stacktrace', 'jamboree'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['stacktrace', 'jamboree'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -274,7 +283,7 @@
isolate->debugger()->SetBreakpointAtLine(url, 3);
// Get the breakpoint list.
- service_msg = Eval(lib, "[port, ['debug', 'breakpoints'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['debug', 'breakpoints'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -286,7 +295,7 @@
handler.msg());
// Individual breakpoint.
- service_msg = Eval(lib, "[port, ['debug', 'breakpoints', '1'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['debug', 'breakpoints', '1'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -297,7 +306,7 @@
handler.msg());
// Missing sub-command.
- service_msg = Eval(lib, "[port, ['debug'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['debug'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -308,7 +317,8 @@
handler.msg());
// Unrecognized breakpoint.
- service_msg = Eval(lib, "[port, ['debug', 'breakpoints', '1111'], [], []]");
+ service_msg = Eval(lib,
+ "[0, port, ['debug', 'breakpoints', '1111'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("{\"type\":\"Error\",\"id\":\"\","
@@ -320,7 +330,7 @@
// Command too long.
service_msg =
- Eval(lib, "[port, ['debug', 'breakpoints', '1111', 'green'], [], []]");
+ Eval(lib, "[0, port, ['debug', 'breakpoints', '1111', 'green'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("{\"type\":\"Error\",\"id\":\"\","
@@ -331,7 +341,7 @@
handler.msg());
// Unrecognized subcommand.
- service_msg = Eval(lib, "[port, ['debug', 'nosferatu'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['debug', 'nosferatu'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("{\"type\":\"Error\",\"id\":\"\","
@@ -377,7 +387,7 @@
Instance& service_msg = Instance::Handle();
// null
- service_msg = Eval(lib, "[port, ['objects', 'null'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'null'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -387,7 +397,7 @@
handler.msg());
// not initialized
- service_msg = Eval(lib, "[port, ['objects', 'not-initialized'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'not-initialized'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -397,7 +407,8 @@
handler.msg());
// being initialized
- service_msg = Eval(lib, "[port, ['objects', 'being-initialized'], [], []]");
+ service_msg = Eval(lib,
+ "[0, port, ['objects', 'being-initialized'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -407,7 +418,7 @@
handler.msg());
// optimized out
- service_msg = Eval(lib, "[port, ['objects', 'optimized-out'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'optimized-out'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -417,7 +428,7 @@
handler.msg());
// collected
- service_msg = Eval(lib, "[port, ['objects', 'collected'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'collected'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -427,7 +438,7 @@
handler.msg());
// expired
- service_msg = Eval(lib, "[port, ['objects', 'expired'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'expired'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -437,7 +448,7 @@
handler.msg());
// bool
- service_msg = Eval(lib, "[port, ['objects', 'bool-true'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'bool-true'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -448,7 +459,7 @@
handler.msg());
// int
- service_msg = Eval(lib, "[port, ['objects', 'int-123'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'int-123'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -462,7 +473,7 @@
handler.msg());
// object id ring / valid
- service_msg = Eval(lib, "[port, ['objects', '$validId'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', '$validId'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -481,7 +492,7 @@
handler.msg());
// object id ring / invalid => expired
- service_msg = Eval(lib, "[port, ['objects', '99999999'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', '99999999'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -491,7 +502,7 @@
handler.msg());
// expired/eval => error
- service_msg = Eval(lib, "[port, ['objects', 'expired', 'eval'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['objects', 'expired', 'eval'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -504,7 +515,7 @@
// int/eval => good
service_msg = Eval(lib,
- "[port, ['objects', 'int-123', 'eval'], "
+ "[0, port, ['objects', 'int-123', 'eval'], "
"['expr'], ['this+99']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -519,7 +530,7 @@
// eval returning null works
service_msg = Eval(lib,
- "[port, ['objects', 'int-123', 'eval'], "
+ "[0, port, ['objects', 'int-123', 'eval'], "
"['expr'], ['null']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -530,7 +541,7 @@
handler.msg());
// object id ring / invalid => expired
- service_msg = Eval(lib, "[port, ['objects', '99999999', 'eval'], "
+ service_msg = Eval(lib, "[0, port, ['objects', '99999999', 'eval'], "
"['expr'], ['this']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -544,7 +555,7 @@
// Extra arg to eval.
service_msg = Eval(lib,
- "[port, ['objects', 'int-123', 'eval', 'foo'], "
+ "[0, port, ['objects', 'int-123', 'eval', 'foo'], "
"['expr'], ['this+99']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -558,7 +569,7 @@
// Retained by single instance.
service_msg = Eval(lib,
- "[port, ['objects', '$validId', 'retained'], [], []]");
+ "[0, port, ['objects', '$validId', 'retained'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
handler.filterMsg("name");
@@ -569,7 +580,7 @@
// Retaining path to 'arr', limit 1.
service_msg = Eval(
lib,
- "[port, ['objects', '$validId', 'retaining_path'], ['limit'], ['1']]");
+ "[0, port, ['objects', '$validId', 'retaining_path'], ['limit'], ['1']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
ExpectSubstringF(
@@ -580,7 +591,7 @@
// Retaining path missing limit.
service_msg = Eval(
lib,
- "[port, ['objects', '$validId', 'retaining_path'], [], []]");
+ "[0, port, ['objects', '$validId', 'retaining_path'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
ExpectSubstringF(handler.msg(), "{\"type\":\"Error\"");
@@ -590,7 +601,7 @@
internal_object = LiteralToken::New();
arr.SetAt(0, internal_object);
service_msg = Eval(lib,
- "[port, ['objects', '$validId', 'eval'], "
+ "[0, port, ['objects', '$validId', 'eval'], "
"['expr'], ['toString()']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -638,7 +649,7 @@
// Request library.
service_msg = EvalF(h_lib,
- "[port, ['libraries', '%" Pd "'], [], []]", lib_id);
+ "[0, port, ['libraries', '%" Pd "'], [], []]", lib_id);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Library\"", handler.msg());
@@ -646,7 +657,7 @@
// Evaluate an expression from a library.
service_msg = EvalF(h_lib,
- "[port, ['libraries', '%" Pd "', 'eval'], "
+ "[0, port, ['libraries', '%" Pd "', 'eval'], "
"['expr'], ['libVar - 1']]", lib_id);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -703,7 +714,7 @@
Instance& service_msg = Instance::Handle();
// Request an invalid class id.
- service_msg = Eval(h_lib, "[port, ['classes', '999999'], [], []]");
+ service_msg = Eval(h_lib, "[0, port, ['classes', '999999'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -713,7 +724,7 @@
"\"option_keys\":[],\"option_values\":[]}}", handler.msg());
// Request the class A over the service.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "'], [], []]", cid);
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "'], [], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Class\"", handler.msg());
@@ -722,7 +733,7 @@
// Evaluate an expression from class A.
service_msg = EvalF(h_lib,
- "[port, ['classes', '%" Pd "', 'eval'], "
+ "[0, port, ['classes', '%" Pd "', 'eval'], "
"['expr'], ['cobra + 100000']]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -736,8 +747,9 @@
handler.msg());
// Request function 0 from class A.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'functions', '0'],"
- "[], []]", cid);
+ service_msg = EvalF(h_lib,
+ "[0, port, ['classes', '%" Pd "', 'functions', '0'],"
+ "[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Function\"", handler.msg());
@@ -746,7 +758,7 @@
"\"name\":\"get:a\",", cid);
// Request field 0 from class A.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'fields', '0'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'fields', '0'],"
"[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -756,7 +768,7 @@
"\"name\":\"a\",", cid);
// Invalid sub command.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'huh', '0'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'huh', '0'],"
"[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -767,7 +779,7 @@
"\"option_values\":[]}}", cid);
// Invalid field request.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'fields', '9'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'fields', '9'],"
"[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -777,8 +789,9 @@
"\"option_keys\":[],\"option_values\":[]}}", cid);
// Invalid function request.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'functions', '9'],"
- "[], []]", cid);
+ service_msg = EvalF(h_lib,
+ "[0, port, ['classes', '%" Pd "', 'functions', '9'],"
+ "[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
ExpectSubstringF(handler.msg(),
@@ -788,8 +801,9 @@
// Invalid field subcommand.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'fields', '9', 'x']"
- ",[], []]", cid);
+ service_msg = EvalF(h_lib,
+ "[0, port, ['classes', '%" Pd "', 'fields', '9', 'x']"
+ ",[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
ExpectSubstringF(handler.msg(),
@@ -799,8 +813,9 @@
"\"option_keys\":[],\"option_values\":[]}}", cid);
// Invalid function request.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'functions', '9',"
- "'x'], [], []]", cid);
+ service_msg = EvalF(h_lib,
+ "[0, port, ['classes', '%" Pd "', 'functions', '9',"
+ "'x'], [], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
ExpectSubstringF(handler.msg(),
@@ -814,7 +829,7 @@
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'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'retained'],"
"[], []]", class_b.id());
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -856,7 +871,7 @@
Instance& service_msg = Instance::Handle();
// Request the class A over the service.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "'], [], []]", cid);
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "'], [], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Class\"", handler.msg());
@@ -865,7 +880,7 @@
"\"id\":\"classes\\/%" Pd "\"", cid);
// Request canonical type 0 from class A.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'types', '0'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'types', '0'],"
"[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -875,7 +890,7 @@
"\"id\":\"classes\\/%" Pd "\\/types\\/0\"", cid);
// Request canonical type 1 from class A.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'types', '1'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'types', '1'],"
"[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -885,7 +900,7 @@
"\"id\":\"classes\\/%" Pd "\\/types\\/1\"", cid);
// Request for non-existent canonical type from class A.
- service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'types', '42'],"
+ service_msg = EvalF(h_lib, "[0, port, ['classes', '%" Pd "', 'types', '42'],"
"[], []]", cid);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -897,7 +912,7 @@
"\"option_keys\":[],\"option_values\":[]}}", cid);
// Request canonical type arguments. Expect <A<bool>> to be listed.
- service_msg = EvalF(h_lib, "[port, ['typearguments'],"
+ service_msg = EvalF(h_lib, "[0, port, ['typearguments'],"
"[], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -905,8 +920,9 @@
ExpectSubstringF(handler.msg(), "\"name\":\"<A<bool>>\",");
// Request canonical type arguments with instantiations.
- service_msg = EvalF(h_lib, "[port, ['typearguments', 'withinstantiations'],"
- "[], []]");
+ service_msg = EvalF(h_lib,
+ "[0, port, ['typearguments', 'withinstantiations'],"
+ "[], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"TypeArgumentsList\"", handler.msg());
@@ -961,7 +977,7 @@
Instance& service_msg = Instance::Handle();
// Request an invalid code object.
- service_msg = Eval(h_lib, "[port, ['code', '0'], [], []]");
+ service_msg = Eval(h_lib, "[0, port, ['code', '0'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -971,7 +987,7 @@
// The following test checks that a code object can be found only
// at compile_timestamp()-code.EntryPoint().
- service_msg = EvalF(h_lib, "[port, ['code', '%" Px64"-%" Px "'], [], []]",
+ service_msg = EvalF(h_lib, "[0, port, ['code', '%" Px64"-%" Px "'], [], []]",
compile_timestamp,
entry);
Service::HandleIsolateMessage(isolate, service_msg);
@@ -990,7 +1006,7 @@
// Request code object at compile_timestamp-code.EntryPoint() + 16
// Expect this to fail because the address is not the entry point.
uintptr_t address = entry + 16;
- service_msg = EvalF(h_lib, "[port, ['code', '%" Px64"-%" Px "'], [], []]",
+ service_msg = EvalF(h_lib, "[0, port, ['code', '%" Px64"-%" Px "'], [], []]",
compile_timestamp,
address);
Service::HandleIsolateMessage(isolate, service_msg);
@@ -1009,7 +1025,7 @@
// Request code object at (compile_timestamp - 1)-code.EntryPoint()
// Expect this to fail because the timestamp is wrong.
address = entry;
- service_msg = EvalF(h_lib, "[port, ['code', '%" Px64"-%" Px "'], [], []]",
+ service_msg = EvalF(h_lib, "[0, port, ['code', '%" Px64"-%" Px "'], [], []]",
compile_timestamp - 1,
address);
Service::HandleIsolateMessage(isolate, service_msg);
@@ -1027,7 +1043,7 @@
// Request native code at address. Expect the null code object back.
address = last;
- service_msg = EvalF(h_lib, "[port, ['code', 'native-%" Px "'], [], []]",
+ service_msg = EvalF(h_lib, "[0, port, ['code', 'native-%" Px "'], [], []]",
address);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -1036,7 +1052,7 @@
handler.msg());
// Request malformed native code.
- service_msg = EvalF(h_lib, "[port, ['code', 'native%" Px "'], [], []]",
+ service_msg = EvalF(h_lib, "[0, port, ['code', 'native%" Px "'], [], []]",
address);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -1063,7 +1079,7 @@
EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(lib, "[port, ['vm'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['vm'], [], []]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
@@ -1095,7 +1111,7 @@
EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(lib, "[port, ['flags'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['flags'], [], []]");
// Make sure we can get the FlagList.
Service::HandleRootMessage(service_msg);
@@ -1108,14 +1124,14 @@
// Modify a flag through the vm service.
service_msg = Eval(lib,
- "[port, ['flags', 'set'], "
+ "[0, port, ['flags', 'set'], "
"['name', 'value'], ['service_testing_flag', 'true']]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("Success", handler.msg());
// Make sure that the flag changed.
- service_msg = Eval(lib, "[port, ['flags'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['flags'], [], []]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING(
@@ -1144,7 +1160,7 @@
EXPECT_VALID(Dart_SetField(h_lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(h_lib, "[port, ['scripts', 'test-lib'], [], []]");
+ service_msg = Eval(h_lib, "[0, port, ['scripts', 'test-lib'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ(
@@ -1187,7 +1203,7 @@
EXPECT_VALID(Dart_SetField(h_lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(h_lib, "[port, ['coverage'], [], []]");
+ service_msg = Eval(h_lib, "[0, port, ['coverage'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING(
@@ -1228,46 +1244,48 @@
EXPECT_VALID(Dart_SetField(h_lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(h_lib, "[port, ['allocationprofile'], [], []]");
+ service_msg = Eval(h_lib, "[0, port, ['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_msg = Eval(h_lib, "[0, 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_msg = Eval(h_lib,
+ "[0, 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_msg = Eval(h_lib,
+ "[0, 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']]");
+ Eval(h_lib, "[0, 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']]");
+ Eval(h_lib, "[0, 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']]");
+ "[0, port, ['allocationprofile'], ['gc', 'reset'], ['full', 'true']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"AllocationProfile\"", handler.msg());
@@ -1293,7 +1311,7 @@
EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(lib, "[port, ['heapmap'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['heapmap'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"HeapMap\"", handler.msg());
@@ -1328,7 +1346,7 @@
uword addr = start_addr + offset;
char buf[1024];
OS::SNPrint(buf, sizeof(buf),
- "[port, ['address', '%" Px "'], [], []]", addr);
+ "[0, port, ['address', '%" Px "'], [], []]", addr);
service_msg = Eval(lib, buf);
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
@@ -1336,7 +1354,7 @@
EXPECT_SUBSTRING("foobar", handler.msg());
}
// Expect null when no object is found.
- service_msg = Eval(lib, "[port, ['address', '7'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['address', '7'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// TODO(turnidge): Should this be a ServiceException instead?
@@ -1398,11 +1416,11 @@
Instance& service_msg = Instance::Handle();
- service_msg = Eval(lib, "[port, ['alpha'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['alpha'], [], []]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("alpha", handler.msg());
- service_msg = Eval(lib, "[port, ['beta'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['beta'], [], []]");
Service::HandleRootMessage(service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("beta", handler.msg());
@@ -1435,11 +1453,11 @@
EXPECT_VALID(Dart_SetField(lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(lib, "[port, ['alpha'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['alpha'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("alpha", handler.msg());
- service_msg = Eval(lib, "[port, ['beta'], [], []]");
+ service_msg = Eval(lib, "[0, port, ['beta'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_STREQ("beta", handler.msg());
@@ -1476,19 +1494,19 @@
EXPECT_VALID(Dart_SetField(h_lib, NewString("port"), port));
Instance& service_msg = Instance::Handle();
- service_msg = Eval(h_lib, "[port, ['profile'], [], []]");
+ service_msg = Eval(h_lib, "[0, port, ['profile'], [], []]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// Expect profile
EXPECT_SUBSTRING("\"type\":\"Profile\"", handler.msg());
- service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hide']]");
+ service_msg = Eval(h_lib, "[0, port, ['profile'], ['tags'], ['hide']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// Expect profile
EXPECT_SUBSTRING("\"type\":\"Profile\"", handler.msg());
- service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]");
+ service_msg = Eval(h_lib, "[0, port, ['profile'], ['tags'], ['hidden']]");
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
// Expect error.
« no previous file with comments | « runtime/vm/service/message.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698