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

Unified Diff: Source/core/workers/WorkerThreadTest.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 | « no previous file | Source/modules/compositorworker/CompositorWorkerManagerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThreadTest.cpp
diff --git a/Source/core/workers/WorkerThreadTest.cpp b/Source/core/workers/WorkerThreadTest.cpp
index 14549166e531cd3b6f08bab8c897ef3212979b5f..9a88e0188365934c96c042624e118e821befa4de 100644
--- a/Source/core/workers/WorkerThreadTest.cpp
+++ b/Source/core/workers/WorkerThreadTest.cpp
@@ -9,10 +9,12 @@
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "platform/NotImplemented.h"
+#include "platform/heap/Heap.h"
#include "public/platform/WebScheduler.h"
#include "public/platform/WebWaitableEvent.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+#include <v8.h>
using testing::_;
using testing::AtMost;
@@ -109,6 +111,12 @@ public:
{
return *m_thread;
}
+ void willDestroyIsolate() override
+ {
+ v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting(v8::Isolate::kFullGarbageCollection);
+ Heap::collectAllGarbage();
+ WorkerThread::willDestroyIsolate();
+ }
MOCK_METHOD1(doIdleGc, bool(double deadlineSeconds));
« no previous file with comments | « no previous file | Source/modules/compositorworker/CompositorWorkerManagerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698