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

Unified Diff: Source/platform/LifecycleContextTest.cpp

Issue 857853002: Oilpan: fix platform unit tests after r188630. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/LifecycleContextTest.cpp
diff --git a/Source/platform/LifecycleContextTest.cpp b/Source/platform/LifecycleContextTest.cpp
index 3289336fb1da9f4171e47905f19db03607a49243..883766a7d17ce8bddf9ab298759c63e836385623 100644
--- a/Source/platform/LifecycleContextTest.cpp
+++ b/Source/platform/LifecycleContextTest.cpp
@@ -88,12 +88,13 @@ public:
TEST(LifecycleContextTest, shouldObserveContextDestroyed)
{
OwnPtrWillBeRawPtr<DummyContext> context = adoptPtrWillBeNoop(new DummyContext());
- TestingObserver* observer = new TestingObserver(context.get());
+ Persistent<TestingObserver> observer = new TestingObserver(context.get());
EXPECT_EQ(observer->lifecycleContext(), context.get());
EXPECT_FALSE(observer->m_contextDestroyedCalled);
context->notifyContextDestroyed();
- context.clear();
+ context = nullptr;
+ Heap::collectAllGarbage();
EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0));
EXPECT_TRUE(observer->m_contextDestroyedCalled);
}
@@ -101,10 +102,11 @@ TEST(LifecycleContextTest, shouldObserveContextDestroyed)
TEST(LifecycleContextTest, shouldNotObserveContextDestroyedIfUnobserve)
{
OwnPtrWillBeRawPtr<DummyContext> context = adoptPtrWillBeNoop(new DummyContext());
- TestingObserver* observer = new TestingObserver(context.get());
+ Persistent<TestingObserver> observer = new TestingObserver(context.get());
observer->unobserve();
context->notifyContextDestroyed();
- context.clear();
+ context = nullptr;
+ Heap::collectAllGarbage();
EXPECT_EQ(observer->lifecycleContext(), static_cast<DummyContext*>(0));
EXPECT_FALSE(observer->m_contextDestroyedCalled);
}
« 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