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

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

Issue 487023003: vmservice protocol cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 3 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/profiler.cc ('k') | runtime/vm/scavenger.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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/report.h" 6 #include "vm/report.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 13 matching lines...) Expand all
24 { 24 {
25 JSONStream js; 25 JSONStream js;
26 trace_buffer->PrintToJSONStream(&js); 26 trace_buffer->PrintToJSONStream(&js);
27 EXPECT_SUBSTRING("{\"type\":\"TraceBuffer\",\"members\":[" 27 EXPECT_SUBSTRING("{\"type\":\"TraceBuffer\",\"members\":["
28 "{\"type\":\"TraceBufferEntry\",\"time\":", 28 "{\"type\":\"TraceBufferEntry\",\"time\":",
29 js.ToCString()); 29 js.ToCString());
30 // Skip time. 30 // Skip time.
31 EXPECT_SUBSTRING("\"message\":{\"type\":\"JSCompatibilityWarning\"," 31 EXPECT_SUBSTRING("\"message\":{\"type\":\"JSCompatibilityWarning\","
32 "\"script\":{\"type\":\"@Script\",\"id\":" 32 "\"script\":{\"type\":\"@Script\",\"id\":"
33 "\"libraries\\/-1\\/scripts\\/Plug\"," 33 "\"libraries\\/-1\\/scripts\\/Plug\","
34 "\"name\":\"Plug\",\"user_name\":" 34 "\"name\":\"Plug\","
35 "\"Plug\",\"kind\":\"script\"},\"tokenPos\":0," 35 "\"kind\":\"script\"},\"tokenPos\":0,"
36 "\"message\":{\"type\":\"@String\"", 36 "\"message\":{\"type\":\"@String\"",
37 js.ToCString()); 37 js.ToCString());
38 // Skip private _OneByteString. 38 // Skip private _OneByteString.
39 EXPECT_SUBSTRING("\"valueAsString\":\"\\\"High Voltage\\\"\"}}", 39 EXPECT_SUBSTRING("\"valueAsString\":\"\\\"High Voltage\\\"\"}}",
40 js.ToCString()); 40 js.ToCString());
41 } 41 }
42 } 42 }
43 { 43 {
44 const intptr_t token_pos = 1; 44 const intptr_t token_pos = 1;
45 const char* message = "Low Voltage"; 45 const char* message = "Low Voltage";
46 Report::MessageF(Report::kJSWarning, script, token_pos, "%s", message); 46 Report::MessageF(Report::kJSWarning, script, token_pos, "%s", message);
47 } 47 }
48 EXPECT_EQ(2, trace_buffer->Length()); 48 EXPECT_EQ(2, trace_buffer->Length());
49 EXPECT_SUBSTRING("{\"type\":\"JSCompatibilityWarning\",\"script\":{\"type\":" 49 EXPECT_SUBSTRING("{\"type\":\"JSCompatibilityWarning\",\"script\":{\"type\":"
50 "\"@Script\",\"id\":\"libraries\\/-1\\/scripts\\/Plug\"," 50 "\"@Script\",\"id\":\"libraries\\/-1\\/scripts\\/Plug\","
51 "\"name\":\"Plug\"," 51 "\"name\":\"Plug\","
52 "\"user_name\":\"Plug\",\"kind\":\"script\"},\"tokenPos\":0," 52 "\"kind\":\"script\"},\"tokenPos\":0,"
53 "\"message\":{\"type\":\"@String\"", 53 "\"message\":{\"type\":\"@String\"",
54 trace_buffer->At(0)->message); 54 trace_buffer->At(0)->message);
55 // Skip private _OneByteString. 55 // Skip private _OneByteString.
56 EXPECT_SUBSTRING("\"valueAsString\":\"\\\"High Voltage\\\"\"}}", 56 EXPECT_SUBSTRING("\"valueAsString\":\"\\\"High Voltage\\\"\"}}",
57 trace_buffer->At(0)->message); 57 trace_buffer->At(0)->message);
58 58
59 EXPECT_SUBSTRING("{\"type\":\"JSCompatibilityWarning\",\"script\":{\"type\":" 59 EXPECT_SUBSTRING("{\"type\":\"JSCompatibilityWarning\",\"script\":{\"type\":"
60 "\"@Script\",\"id\":\"libraries\\/-1\\/scripts\\/Plug\"," 60 "\"@Script\",\"id\":\"libraries\\/-1\\/scripts\\/Plug\","
61 "\"name\":\"Plug\"," 61 "\"name\":\"Plug\","
62 "\"user_name\":\"Plug\",\"kind\":\"script\"},\"tokenPos\":1," 62 "\"kind\":\"script\"},\"tokenPos\":1,"
63 "\"message\":{\"type\":\"@String\"", 63 "\"message\":{\"type\":\"@String\"",
64 trace_buffer->At(1)->message); 64 trace_buffer->At(1)->message);
65 // Skip private _OneByteString. 65 // Skip private _OneByteString.
66 EXPECT_SUBSTRING("\"valueAsString\":\"\\\"Low Voltage\\\"\"}}", 66 EXPECT_SUBSTRING("\"valueAsString\":\"\\\"Low Voltage\\\"\"}}",
67 trace_buffer->At(1)->message); 67 trace_buffer->At(1)->message);
68 68
69 delete trace_buffer; 69 delete trace_buffer;
70 } 70 }
71 71
72 } // namespace dart 72 } // namespace dart
73
OLDNEW
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698