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

Unified Diff: runtime/vm/service_test.cc

Issue 211283004: Support Types in instance-ref/instance-view (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js 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 d71a78039dfaf4c9efb2c8c9456dd33c9a9087cc..91b2a56aa776f1dab8a4640cd2416910258e8f59 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -112,6 +112,9 @@ static RawInstance* EvalF(Dart_Handle lib, const char* fmt, ...) {
// Search for the formatted string in buff.
+//
+// TODO(turnidge): This function obscures the line number of failing
+// EXPECTs. Rework this.
static void ExpectSubstringF(const char* buff, const char* fmt, ...) {
Isolate* isolate = Isolate::Current();
@@ -456,10 +459,10 @@ TEST_CASE(Service_Objects) {
handler.filterMsg("name");
handler.filterMsg("size");
EXPECT_STREQ(
- "{\"type\":\"String\",\"id\":\"objects\\/1\","
+ "{\"type\":\"String\","
"\"class\":{\"type\":\"@Class\",\"id\":\"classes\\/60\","
- "\"user_name\":\"String\"},\"preview\":\"\\\"value\\\"\","
- "\"fields\":[],}",
+ "\"user_name\":\"String\"},\"fields\":[],"
+ "\"id\":\"objects\\/1\",\"preview\":\"\\\"value\\\"\"}",
handler.msg());
// object id ring / invalid => expired
@@ -781,8 +784,9 @@ TEST_CASE(Service_Types) {
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Class\"", handler.msg());
+ EXPECT_SUBSTRING("\"name\":\"A\"", handler.msg());
ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\",\"name\":\"A\",", cid);
+ "\"id\":\"classes\\/%" Pd "\"", cid);
// Request canonical type 0 from class A.
service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'types', '0'],"
@@ -790,9 +794,9 @@ TEST_CASE(Service_Types) {
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Type\"", handler.msg());
+ EXPECT_SUBSTRING("\"name\":\"A<bool>\"", handler.msg());
ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\\/types\\/0\","
- "\"name\":\"A<bool>\",", cid);
+ "\"id\":\"classes\\/%" Pd "\\/types\\/0\"", cid);
// Request canonical type 1 from class A.
service_msg = EvalF(h_lib, "[port, ['classes', '%" Pd "', 'types', '1'],"
@@ -800,9 +804,9 @@ TEST_CASE(Service_Types) {
Service::HandleIsolateMessage(isolate, service_msg);
handler.HandleNextMessage();
EXPECT_SUBSTRING("\"type\":\"Type\"", handler.msg());
+ EXPECT_SUBSTRING("\"name\":\"A<A<bool>>\"", handler.msg());
ExpectSubstringF(handler.msg(),
- "\"id\":\"classes\\/%" Pd "\\/types\\/1\","
- "\"name\":\"A<A<bool>>\",", cid);
+ "\"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'],"
« 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