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

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

Issue 452723002: Oilpan: blink_heap_unittests: Test case have memory leak checked by Lsan (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | 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 1aafc8a11ed9fe2206c0b5e1b1d344df71588f18..ae3039ff401c49689dbd47adedfecd2575932395 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -4152,6 +4152,10 @@ TEST(HeapTest, MapWithCustomWeaknessHandling)
++i1;
EXPECT_TRUE(i1->key.first->value() == 103 || i1->key.first == livingInt);
EXPECT_EQ(livingInt, i1->key.second);
+
+ map1.clear();
+ livingInt.clear();
haraken 2014/08/11 02:00:07 Hmm, I don't fully understand why we need to call
Daniel Chow 2014/08/11 02:44:21 it's a good idea, I will make a try today On 2014
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
}
TEST(HeapTest, MapWithCustomWeaknessHandling2)
@@ -4223,6 +4227,10 @@ TEST(HeapTest, MapWithCustomWeaknessHandling2)
++i1;
EXPECT_TRUE(i1->value.first->value() == 103 || i1->value.first == livingInt);
EXPECT_EQ(livingInt, i1->value.second);
+
+ map1.clear();
+ livingInt.clear();
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
}
TEST(HeapTest, Bind)
@@ -4975,12 +4983,13 @@ TEST(HeapTest, RecursiveMutex)
}
template<typename T>
-class TraceIfNeededTester : public GarbageCollected<TraceIfNeededTester<T> > {
+class TraceIfNeededTester : public GarbageCollectedFinalized<TraceIfNeededTester<T> > {
haraken 2014/08/11 02:00:07 This change looks correct. Ian: It would be great
public:
static TraceIfNeededTester<T>* create() { return new TraceIfNeededTester<T>(); }
static TraceIfNeededTester<T>* create(const T& obj) { return new TraceIfNeededTester<T>(obj); }
void trace(Visitor* visitor) { TraceIfNeeded<T>::trace(visitor, &m_obj); }
T& obj() { return m_obj; }
+ ~TraceIfNeededTester() { }
private:
TraceIfNeededTester() { }
explicit TraceIfNeededTester(const T& obj) : m_obj(obj) { }
@@ -5028,6 +5037,8 @@ TEST(HeapTest, TraceIfNeeded)
m_vec->trace(&visitor);
EXPECT_EQ(2u, visitor.count());
}
+
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
}
} // namespace blink
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698