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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h

Issue 2025783002: Worker: Introduce an observation mechanism for WorkerThread termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delayed_task
Patch Set: Stop tracing CrossThread(Weak)Persistents Created 4 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
Index: third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
index b64dc4719c206d6cdf1dbe6996bae88604f24551..fdafbd9746ee84c1a7494c686deeddf9279a6fac 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
+++ b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
@@ -12,6 +12,7 @@
#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerReportingProxy.h"
#include "core/workers/WorkerThread.h"
+#include "core/workers/WorkerThreadLifecycleObserver.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "platform/ThreadSafeFunctional.h"
#include "platform/WaitableEvent.h"
@@ -68,6 +69,16 @@ public:
MOCK_METHOD0(willDestroyWorkerGlobalScope, void());
};
+class MockWorkerThreadLifecycleObserver final : public GarbageCollectedFinalized<MockWorkerThreadLifecycleObserver>, public WorkerThreadLifecycleObserver {
+ USING_GARBAGE_COLLECTED_MIXIN(MockWorkerThreadLifecycleObserver);
+ WTF_MAKE_NONCOPYABLE(MockWorkerThreadLifecycleObserver);
+public:
+ explicit MockWorkerThreadLifecycleObserver(WorkerThreadContext* context)
+ : WorkerThreadLifecycleObserver(context) { }
+
+ MOCK_METHOD0(contextDestroyed, void());
+};
+
class WorkerThreadForTest : public WorkerThread {
public:
WorkerThreadForTest(

Powered by Google App Engine
This is Rietveld 408576698