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

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

Issue 319373002: Revert of Revert of Oilpan: Prepare to make ExecutionContext GarbageCollectedMixin. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/HeapTest.cpp
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp
index 5c93ea68e5a3d0207641dd5d8846a9288692f6cd..3a2fc82352eb5577309670aef54433018fc3fc6a 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -3978,4 +3978,24 @@
EXPECT_FALSE(NeedsAdjustAndMark<const UseMixin>::value);
}
+TEST(HeapTest, Bind)
+{
+ Closure closure = bind(&Bar::trace, Bar::create(), static_cast<Visitor*>(0));
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
+ // The closure should have a persistent handle to the Bar.
+ EXPECT_EQ(1u, Bar::s_live);
+
+ Closure closure2 = bind(&Bar::trace, RawPtr<Bar>(Bar::create()), static_cast<Visitor*>(0));
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
+ // The closure should have a persistent handle to the Bar.
+ EXPECT_EQ(2u, Bar::s_live);
+
+ UseMixin::s_traceCount = 0;
+ Mixin* mixin = UseMixin::create();
+ Closure mixinClosure = bind(&Mixin::trace, mixin, static_cast<Visitor*>(0));
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
+ // The closure should have a persistent handle to the mixin.
+ EXPECT_EQ(1, UseMixin::s_traceCount);
+}
+
} // WebCore namespace
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/web/WebSharedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698