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

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 983833006: Remove uid and title from HeapSnapshot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@cpu-profiling
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« include/v8-profiler.h ('K') | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index a26edd5358f45c7f5707b225b3f9cd47e65e3abd..214100f6fe3f7fdc62075eeb882b0888e97b58e2 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -1616,16 +1616,13 @@ TEST(DeleteAllHeapSnapshots) {
}
-static const v8::HeapSnapshot* FindHeapSnapshot(v8::HeapProfiler* profiler,
- unsigned uid) {
+static bool FindHeapSnapshot(v8::HeapProfiler* profiler,
+ const v8::HeapSnapshot* snapshot) {
int length = profiler->GetSnapshotCount();
for (int i = 0; i < length; i++) {
- const v8::HeapSnapshot* snapshot = profiler->GetHeapSnapshot(i);
- if (snapshot->GetUid() == uid) {
- return snapshot;
- }
+ if (snapshot == profiler->GetHeapSnapshot(i)) return true;
}
- return NULL;
+ return false;
}
@@ -1640,33 +1637,29 @@ TEST(DeleteHeapSnapshot) {
CHECK(s1);
CHECK_EQ(1, heap_profiler->GetSnapshotCount());
- unsigned uid1 = s1->GetUid();
- CHECK_EQ(s1, FindHeapSnapshot(heap_profiler, uid1));
+ CHECK(FindHeapSnapshot(heap_profiler, s1));
const_cast<v8::HeapSnapshot*>(s1)->Delete();
CHECK_EQ(0, heap_profiler->GetSnapshotCount());
- CHECK(!FindHeapSnapshot(heap_profiler, uid1));
+ CHECK(!FindHeapSnapshot(heap_profiler, s1));
const v8::HeapSnapshot* s2 =
heap_profiler->TakeHeapSnapshot(v8_str("2"));
CHECK(s2);
CHECK_EQ(1, heap_profiler->GetSnapshotCount());
- unsigned uid2 = s2->GetUid();
- CHECK_NE(static_cast<int>(uid1), static_cast<int>(uid2));
- CHECK_EQ(s2, FindHeapSnapshot(heap_profiler, uid2));
+ CHECK(FindHeapSnapshot(heap_profiler, s2));
const v8::HeapSnapshot* s3 =
heap_profiler->TakeHeapSnapshot(v8_str("3"));
CHECK(s3);
CHECK_EQ(2, heap_profiler->GetSnapshotCount());
- unsigned uid3 = s3->GetUid();
- CHECK_NE(static_cast<int>(uid1), static_cast<int>(uid3));
- CHECK_EQ(s3, FindHeapSnapshot(heap_profiler, uid3));
+ CHECK_NE(s2, s3);
+ CHECK(FindHeapSnapshot(heap_profiler, s3));
const_cast<v8::HeapSnapshot*>(s2)->Delete();
CHECK_EQ(1, heap_profiler->GetSnapshotCount());
- CHECK(!FindHeapSnapshot(heap_profiler, uid2));
- CHECK_EQ(s3, FindHeapSnapshot(heap_profiler, uid3));
+ CHECK(!FindHeapSnapshot(heap_profiler, s2));
+ CHECK(FindHeapSnapshot(heap_profiler, s3));
const_cast<v8::HeapSnapshot*>(s3)->Delete();
CHECK_EQ(0, heap_profiler->GetSnapshotCount());
- CHECK(!FindHeapSnapshot(heap_profiler, uid3));
+ CHECK(!FindHeapSnapshot(heap_profiler, s3));
}
« include/v8-profiler.h ('K') | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698