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

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

Issue 1157173005: Include 'fixedId' key when printing service ids (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/metrics.cc » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "platform/json.h" 6 #include "platform/json.h"
7 #include "vm/json_stream.h" 7 #include "vm/json_stream.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 10
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 293
294 TEST_CASE(JSON_JSONStream_DartObject) { 294 TEST_CASE(JSON_JSONStream_DartObject) {
295 JSONStream js; 295 JSONStream js;
296 { 296 {
297 JSONArray jsarr(&js); 297 JSONArray jsarr(&js);
298 jsarr.AddValue(Object::Handle(Object::null())); 298 jsarr.AddValue(Object::Handle(Object::null()));
299 JSONObject jsobj(&jsarr); 299 JSONObject jsobj(&jsarr);
300 jsobj.AddProperty("object_key", Object::Handle(Object::null())); 300 jsobj.AddProperty("object_key", Object::Handle(Object::null()));
301 } 301 }
302 EXPECT_STREQ("[{\"type\":\"@null\",\"id\":\"objects\\/null\"," 302 EXPECT_STREQ("[{\"type\":\"@null\",\"fixedId\":true,"
303 "\"id\":\"objects\\/null\","
303 "\"valueAsString\":\"null\"}," 304 "\"valueAsString\":\"null\"},"
304 "{\"object_key\":{\"type\":\"@null\",\"id\":\"objects\\/null\"," 305 "{\"object_key\":{\"type\":\"@null\",\"fixedId\":true,"
306 "\"id\":\"objects\\/null\","
305 "\"valueAsString\":\"null\"}}]", 307 "\"valueAsString\":\"null\"}}]",
306 js.ToCString()); 308 js.ToCString());
307 } 309 }
308 310
309 TEST_CASE(JSON_JSONStream_EscapedString) { 311 TEST_CASE(JSON_JSONStream_EscapedString) {
310 JSONStream js; 312 JSONStream js;
311 { 313 {
312 JSONArray jsarr(&js); 314 JSONArray jsarr(&js);
313 jsarr.AddValue("Hel\"\"lo\r\n\t"); 315 jsarr.AddValue("Hel\"\"lo\r\n\t");
314 } 316 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 js.SetParams(&param_keys[0], &param_values[0], 2); 401 js.SetParams(&param_keys[0], &param_values[0], 2);
400 EXPECT(js.num_params() == 2); 402 EXPECT(js.num_params() == 2);
401 EXPECT(!js.HasParam("lizard")); 403 EXPECT(!js.HasParam("lizard"));
402 EXPECT(js.HasParam("dog")); 404 EXPECT(js.HasParam("dog"));
403 EXPECT(js.HasParam("cat")); 405 EXPECT(js.HasParam("cat"));
404 EXPECT(js.ParamIs("cat", "banana")); 406 EXPECT(js.ParamIs("cat", "banana"));
405 EXPECT(!js.ParamIs("dog", "banana")); 407 EXPECT(!js.ParamIs("dog", "banana"));
406 } 408 }
407 409
408 } // namespace dart 410 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698