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

Side by Side Diff: test/cctest/test-heap-profiler.cc

Issue 5314003: New Heap profiler: fix JSON serialization of aggregated profiles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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
« src/profile-generator.cc ('K') | « src/profile-generator.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // 2 //
3 // Tests for heap profiler 3 // Tests for heap profiler
4 4
5 #ifdef ENABLE_LOGGING_AND_PROFILING 5 #ifdef ENABLE_LOGGING_AND_PROFILING
6 6
7 #include "v8.h" 7 #include "v8.h"
8 #include "heap-profiler.h" 8 #include "heap-profiler.h"
9 #include "snapshot.h" 9 #include "snapshot.h"
10 #include "string-stream.h" 10 #include "string-stream.h"
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 v8::HandleScope scope; 1171 v8::HandleScope scope;
1172 LocalContext env; 1172 LocalContext env;
1173 const v8::HeapSnapshot* snapshot = 1173 const v8::HeapSnapshot* snapshot =
1174 v8::HeapProfiler::TakeSnapshot(v8::String::New("abort")); 1174 v8::HeapProfiler::TakeSnapshot(v8::String::New("abort"));
1175 TestJSONStream stream(5); 1175 TestJSONStream stream(5);
1176 snapshot->Serialize(&stream, v8::HeapSnapshot::kJSON); 1176 snapshot->Serialize(&stream, v8::HeapSnapshot::kJSON);
1177 CHECK_GT(stream.size(), 0); 1177 CHECK_GT(stream.size(), 0);
1178 CHECK_EQ(0, stream.eos_signaled()); 1178 CHECK_EQ(0, stream.eos_signaled());
1179 } 1179 }
1180 1180
1181
1182 // Must not crash in debug mode.
1183 TEST(AggregatedHeapSnapshotJSONSerialization) {
1184 v8::HandleScope scope;
1185 LocalContext env;
1186
1187 const v8::HeapSnapshot* snapshot =
1188 v8::HeapProfiler::TakeSnapshot(
1189 v8::String::New("agg"), v8::HeapSnapshot::kAggregated);
1190 TestJSONStream stream;
1191 snapshot->Serialize(&stream, v8::HeapSnapshot::kJSON);
1192 CHECK_GT(stream.size(), 0);
1193 CHECK_EQ(1, stream.eos_signaled());
1194 }
1195
1181 #endif // ENABLE_LOGGING_AND_PROFILING 1196 #endif // ENABLE_LOGGING_AND_PROFILING
OLDNEW
« src/profile-generator.cc ('K') | « src/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698