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

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

Issue 10357003: Beginnings of a debugger wire protocol (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/json.cc ('k') | runtime/vm/vm_sources.gypi » ('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 "vm/json.h" 6 #include "platform/json.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 11
12 TEST_CASE(JSON_ScanJSON) { 12 TEST_CASE(JSON_ScanJSON) {
13 const char* msg = "{ \"id\": 5, \"command\" : \"Debugger.pause\" }"; 13 const char* msg = "{ \"id\": 5, \"command\" : \"Debugger.pause\" }";
14 14
15 JSONScanner scanner(msg); 15 JSONScanner scanner(msg);
16 EXPECT_EQ(scanner.CurrentToken(), JSONScanner::TokenIllegal); 16 EXPECT_EQ(scanner.CurrentToken(), JSONScanner::TokenIllegal);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 EXPECT_STREQ("{ \"length\" : 175, \"command\" : \"stopIt\" }", w.buf()); 110 EXPECT_STREQ("{ \"length\" : 175, \"command\" : \"stopIt\" }", w.buf());
111 111
112 JSONReader r(w.buf()); 112 JSONReader r(w.buf());
113 bool found = r.Seek("command"); 113 bool found = r.Seek("command");
114 EXPECT(found); 114 EXPECT(found);
115 EXPECT_EQ(r.Type(), JSONReader::kString); 115 EXPECT_EQ(r.Type(), JSONReader::kString);
116 EXPECT(r.IsStringLiteral("stopIt")); 116 EXPECT(r.IsStringLiteral("stopIt"));
117 } 117 }
118 118
119 } // namespace dart 119 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698