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

Unified Diff: Source/platform/heap/HeapTest.cpp

Issue 802593004: WebAudio: Fix AudioNode leak in a case that AudioNode is not disconnected from the graph explicitly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 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
Index: Source/platform/heap/HeapTest.cpp
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp
index 3cfbc5357d5efa316d8e47d287330a358c4c8172..5d0f2b2136eb08a45d9741f705b82a89bb54ed3c 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -5571,4 +5571,18 @@ TEST(HeapTest, StackGrowthDirection)
EXPECT_EQ(GrowsTowardsLower, stackGrowthDirection());
}
+TEST(HeapTest, Zombie)
+{
+ Bar::s_live = 0;
+ Baz* baz = Baz::create(Bar::create());
+ ThreadState::current()->markAsZombie(baz);
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
+ // |baz| and a Bar shouldn't be collected.
+ EXPECT_EQ(1u, Bar::s_live);
+
+ ThreadState::current()->purifyZombies();
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
+ EXPECT_EQ(0u, Bar::s_live);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698