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

Unified Diff: Source/modules/compositorworker/CompositorWorkerManagerTest.cpp

Issue 1316233004: Force running GC on the worker thread before the unit test exits (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix test Created 5 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 | « Source/core/workers/WorkerThreadTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
diff --git a/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp b/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
index 4aac3229f03c8864523fef6880e79a80aefe729c..76ad7dbd774b7296c4ea41b087b16ac1bc75388e 100644
--- a/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
+++ b/Source/modules/compositorworker/CompositorWorkerManagerTest.cpp
@@ -14,10 +14,12 @@
#include "modules/compositorworker/CompositorWorkerThread.h"
#include "platform/NotImplemented.h"
#include "platform/ThreadSafeFunctional.h"
+#include "platform/heap/Heap.h"
#include "platform/testing/UnitTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebWaitableEvent.h"
#include <gtest/gtest.h>
+#include <v8.h>
namespace blink {
namespace {
@@ -49,6 +51,12 @@ private:
if (m_v8TerminationCallback)
(*m_v8TerminationCallback)();
}
+ void willDestroyIsolate() override
+ {
+ v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting(v8::Isolate::kFullGarbageCollection);
+ Heap::collectAllGarbage();
+ CompositorWorkerThread::willDestroyIsolate();
+ }
WebWaitableEvent* m_startEvent;
OwnPtr<Function<void()>> m_v8TerminationCallback;
« no previous file with comments | « Source/core/workers/WorkerThreadTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698