OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Tests for heap profiler | 3 // Tests for heap profiler |
4 | 4 |
5 #include <ctype.h> | 5 #include <ctype.h> |
6 | 6 |
7 #include "v8.h" | 7 #include "v8.h" |
8 | 8 |
9 #include "cctest.h" | 9 #include "cctest.h" |
10 #include "hashmap.h" | 10 #include "hashmap.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 CHECK_EQ(1, stream.eos_signaled()); | 707 CHECK_EQ(1, stream.eos_signaled()); |
708 return stream; | 708 return stream; |
709 } | 709 } |
710 | 710 |
711 | 711 |
712 TEST(HeapSnapshotObjectsStats) { | 712 TEST(HeapSnapshotObjectsStats) { |
713 v8::HandleScope scope; | 713 v8::HandleScope scope; |
714 LocalContext env; | 714 LocalContext env; |
715 | 715 |
716 v8::HeapProfiler::StartHeapObjectsTracking(); | 716 v8::HeapProfiler::StartHeapObjectsTracking(); |
717 // We have to call GC 5 times. In other case the garbage will be | 717 // We have to call GC 6 times. In other case the garbage will be |
718 // the reason of flakiness. | 718 // the reason of flakiness. |
719 for (int i = 0; i < 5; ++i) { | 719 for (int i = 0; i < 6; ++i) { |
720 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); | 720 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); |
721 } | 721 } |
722 | 722 |
723 v8::SnapshotObjectId initial_id; | 723 v8::SnapshotObjectId initial_id; |
724 { | 724 { |
725 // Single chunk of data expected in update. Initial data. | 725 // Single chunk of data expected in update. Initial data. |
726 TestStatsStream stats_update = GetHeapStatsUpdate(&initial_id); | 726 TestStatsStream stats_update = GetHeapStatsUpdate(&initial_id); |
727 CHECK_EQ(1, stats_update.intervals_count()); | 727 CHECK_EQ(1, stats_update.intervals_count()); |
728 CHECK_EQ(1, stats_update.updates_written()); | 728 CHECK_EQ(1, stats_update.updates_written()); |
729 CHECK_LT(0, stats_update.entries_size()); | 729 CHECK_LT(0, stats_update.entries_size()); |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 const v8::HeapGraphNode* global_object = | 1619 const v8::HeapGraphNode* global_object = |
1620 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); | 1620 GetProperty(global, v8::HeapGraphEdge::kProperty, "global_object"); |
1621 CHECK_NE(NULL, global_object); | 1621 CHECK_NE(NULL, global_object); |
1622 const v8::HeapGraphNode* properties = | 1622 const v8::HeapGraphNode* properties = |
1623 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); | 1623 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "properties"); |
1624 CHECK_EQ(NULL, properties); | 1624 CHECK_EQ(NULL, properties); |
1625 const v8::HeapGraphNode* elements = | 1625 const v8::HeapGraphNode* elements = |
1626 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); | 1626 GetProperty(global_object, v8::HeapGraphEdge::kInternal, "elements"); |
1627 CHECK_EQ(NULL, elements); | 1627 CHECK_EQ(NULL, elements); |
1628 } | 1628 } |
OLD | NEW |