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

Side by Side Diff: runtime/vm/service_test.cc

Issue 257053003: Always use the same json for null in the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // TODO(zra): Remove when tests are ready to enable. 5 // TODO(zra): Remove when tests are ready to enable.
6 #include "platform/globals.h" 6 #include "platform/globals.h"
7 #if !defined(TARGET_ARCH_ARM64) 7 #if !defined(TARGET_ARCH_ARM64)
8 8
9 #include "include/dart_debugger_api.h" 9 #include "include/dart_debugger_api.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 address); 955 address);
956 EXPECT_SUBSTRING(buffer, handler.msg()); 956 EXPECT_SUBSTRING(buffer, handler.msg());
957 } 957 }
958 958
959 // Request native code at address. Expect the null code object back. 959 // Request native code at address. Expect the null code object back.
960 address = last; 960 address = last;
961 service_msg = EvalF(h_lib, "[port, ['code', 'native-%" Px "'], [], []]", 961 service_msg = EvalF(h_lib, "[port, ['code', 'native-%" Px "'], [], []]",
962 address); 962 address);
963 Service::HandleIsolateMessage(isolate, service_msg); 963 Service::HandleIsolateMessage(isolate, service_msg);
964 handler.HandleNextMessage(); 964 handler.HandleNextMessage();
965 EXPECT_STREQ("{\"type\":\"null\"}", handler.msg()); 965 EXPECT_STREQ("{\"type\":\"Null\",\"id\":\"objects\\/null\","
966 "\"valueAsString\":\"null\"}",
967 handler.msg());
966 968
967 // Request malformed native code. 969 // Request malformed native code.
968 service_msg = EvalF(h_lib, "[port, ['code', 'native%" Px "'], [], []]", 970 service_msg = EvalF(h_lib, "[port, ['code', 'native%" Px "'], [], []]",
969 address); 971 address);
970 Service::HandleIsolateMessage(isolate, service_msg); 972 Service::HandleIsolateMessage(isolate, service_msg);
971 handler.HandleNextMessage(); 973 handler.HandleNextMessage();
972 EXPECT_SUBSTRING("\"message\":\"Malformed code id:", handler.msg()); 974 EXPECT_SUBSTRING("\"message\":\"Malformed code id:", handler.msg());
973 } 975 }
974 976
975 977
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 service_msg = Eval(lib, buf); 1208 service_msg = Eval(lib, buf);
1207 Service::HandleIsolateMessage(isolate, service_msg); 1209 Service::HandleIsolateMessage(isolate, service_msg);
1208 handler.HandleNextMessage(); 1210 handler.HandleNextMessage();
1209 EXPECT_SUBSTRING("\"type\":\"@String\"", handler.msg()); 1211 EXPECT_SUBSTRING("\"type\":\"@String\"", handler.msg());
1210 EXPECT_SUBSTRING("foobar", handler.msg()); 1212 EXPECT_SUBSTRING("foobar", handler.msg());
1211 } 1213 }
1212 // Expect null when no object is found. 1214 // Expect null when no object is found.
1213 service_msg = Eval(lib, "[port, ['address', '7'], [], []]"); 1215 service_msg = Eval(lib, "[port, ['address', '7'], [], []]");
1214 Service::HandleIsolateMessage(isolate, service_msg); 1216 Service::HandleIsolateMessage(isolate, service_msg);
1215 handler.HandleNextMessage(); 1217 handler.HandleNextMessage();
1216 EXPECT_SUBSTRING("\"type\":\"null\"", handler.msg()); 1218 // TODO(turnidge): Should this be a ServiceException instead?
1219 EXPECT_STREQ("{\"type\":\"@Null\",\"id\":\"objects\\/null\","
1220 "\"valueAsString\":\"null\"}",
1221 handler.msg());
1217 } 1222 }
1218 1223
1219 1224
1220 static const char* alpha_callback( 1225 static const char* alpha_callback(
1221 const char* name, 1226 const char* name,
1222 const char** arguments, 1227 const char** arguments,
1223 intptr_t num_arguments, 1228 intptr_t num_arguments,
1224 const char** option_keys, 1229 const char** option_keys,
1225 const char** option_values, 1230 const char** option_values,
1226 intptr_t num_options, 1231 intptr_t num_options,
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]"); 1363 service_msg = Eval(h_lib, "[port, ['profile'], ['tags'], ['hidden']]");
1359 Service::HandleIsolateMessage(isolate, service_msg); 1364 Service::HandleIsolateMessage(isolate, service_msg);
1360 handler.HandleNextMessage(); 1365 handler.HandleNextMessage();
1361 // Expect error. 1366 // Expect error.
1362 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg()); 1367 EXPECT_SUBSTRING("\"type\":\"Error\"", handler.msg());
1363 } 1368 }
1364 1369
1365 } // namespace dart 1370 } // namespace dart
1366 1371
1367 #endif // !defined(TARGET_ARCH_ARM64) 1372 #endif // !defined(TARGET_ARCH_ARM64)
OLDNEW
« 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