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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp

Issue 2337003002: Worker: Notify WorkerThread lifecycle events via WorkerReportingProxy (Closed)
Patch Set: fix tests Created 4 years, 3 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/WorkerThreadTest.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
index b282cbc93a654428bc9591e0ec3902b12301e094..507d696e366bc212a5b9ef4cf680f37bccdc002e 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
@@ -104,6 +104,7 @@ protected:
void expectReportingCalls()
{
EXPECT_CALL(*m_mockWorkerReportingProxy, workerGlobalScopeStarted(_)).Times(1);
+ EXPECT_CALL(*m_mockWorkerReportingProxy, didLoadWorkerScriptMock(_, _)).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, didEvaluateWorkerScript(true)).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, workerThreadTerminated()).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, willDestroyWorkerGlobalScope()).Times(1);
@@ -112,6 +113,7 @@ protected:
void expectReportingCallsForWorkerPossiblyTerminatedBeforeInitialization()
{
EXPECT_CALL(*m_mockWorkerReportingProxy, workerGlobalScopeStarted(_)).Times(AtMost(1));
+ EXPECT_CALL(*m_mockWorkerReportingProxy, didLoadWorkerScriptMock(_, _)).Times(AtMost(1));
EXPECT_CALL(*m_mockWorkerReportingProxy, didEvaluateWorkerScript(_)).Times(AtMost(1));
EXPECT_CALL(*m_mockWorkerReportingProxy, workerThreadTerminated()).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, willDestroyWorkerGlobalScope()).Times(AtMost(1));
@@ -120,6 +122,7 @@ protected:
void expectReportingCallsForWorkerForciblyTerminated()
{
EXPECT_CALL(*m_mockWorkerReportingProxy, workerGlobalScopeStarted(_)).Times(1);
+ EXPECT_CALL(*m_mockWorkerReportingProxy, didLoadWorkerScriptMock(_, _)).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, didEvaluateWorkerScript(false)).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, workerThreadTerminated()).Times(1);
EXPECT_CALL(*m_mockWorkerReportingProxy, willDestroyWorkerGlobalScope()).Times(1);
@@ -262,7 +265,7 @@ TEST_F(WorkerThreadTest, StartAndTerminateOnScriptLoaded_SyncForciblyTerminate)
{
expectReportingCallsForWorkerForciblyTerminated();
startWithSourceCodeNotToFinish();
- m_workerThread->waitUntilScriptLoaded();
+ m_mockWorkerReportingProxy->waitUntilScriptLoaded();
// terminateAndWait() synchronously terminates the worker execution.
m_workerThread->terminateAndWait();
@@ -276,7 +279,7 @@ TEST_F(WorkerThreadTest, StartAndTerminateOnScriptLoaded_AsyncForciblyTerminate)
expectReportingCallsForWorkerForciblyTerminated();
startWithSourceCodeNotToFinish();
- m_workerThread->waitUntilScriptLoaded();
+ m_mockWorkerReportingProxy->waitUntilScriptLoaded();
// terminate() schedules a force termination task.
m_workerThread->terminate();
@@ -296,7 +299,7 @@ TEST_F(WorkerThreadTest, StartAndTerminateOnScriptLoaded_AsyncForciblyTerminate_
expectReportingCallsForWorkerForciblyTerminated();
startWithSourceCodeNotToFinish();
- m_workerThread->waitUntilScriptLoaded();
+ m_mockWorkerReportingProxy->waitUntilScriptLoaded();
// terminate() schedules a force termination task.
m_workerThread->terminate();
@@ -321,7 +324,7 @@ TEST_F(WorkerThreadTest, StartAndTerminateOnScriptLoaded_SyncForciblyTerminateAf
expectReportingCallsForWorkerForciblyTerminated();
startWithSourceCodeNotToFinish();
- m_workerThread->waitUntilScriptLoaded();
+ m_mockWorkerReportingProxy->waitUntilScriptLoaded();
// terminate() schedules a force termination task.
m_workerThread->terminate();
@@ -338,7 +341,7 @@ TEST_F(WorkerThreadTest, StartAndTerminateOnScriptLoaded_TerminateWhileDebuggerT
{
expectReportingCallsForWorkerForciblyTerminated();
startWithSourceCodeNotToFinish();
- m_workerThread->waitUntilScriptLoaded();
+ m_mockWorkerReportingProxy->waitUntilScriptLoaded();
// Simulate that a debugger task is running.
m_workerThread->m_runningDebuggerTask = true;

Powered by Google App Engine
This is Rietveld 408576698