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

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

Issue 2578053002: Worker: Stop running worker tests with BlinkGC::MainThreadHeapMode (Closed)
Patch Set: Created 4 years 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 94b5f449ac53e7ce8197be32a4573ec31398665e..47937ce3f5a450a60b882108be036a2d53b4149d 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
@@ -36,10 +36,9 @@ void waitForSignalTask(WorkerThread* workerThread,
} // namespace
-class WorkerThreadTest
- : public ::testing::TestWithParam<BlinkGC::ThreadHeapMode> {
+class WorkerThreadTest : public ::testing::Test {
public:
- WorkerThreadTest() : m_threadHeapMode(GetParam()) {}
+ WorkerThreadTest() {}
void SetUp() override {
m_loaderProxyProvider = WTF::makeUnique<MockWorkerLoaderProxyProvider>();
@@ -47,7 +46,7 @@ class WorkerThreadTest
m_securityOrigin =
SecurityOrigin::create(KURL(ParsedURLString, "http://fake.url/"));
m_workerThread = WTF::wrapUnique(new WorkerThreadForTest(
- m_loaderProxyProvider.get(), *m_reportingProxy, m_threadHeapMode));
+ m_loaderProxyProvider.get(), *m_reportingProxy));
m_lifecycleObserver = new MockWorkerThreadLifecycleObserver(
m_workerThread->getWorkerThreadLifecycleContext());
}
@@ -119,18 +118,9 @@ class WorkerThreadTest
std::unique_ptr<MockWorkerReportingProxy> m_reportingProxy;
std::unique_ptr<WorkerThreadForTest> m_workerThread;
Persistent<MockWorkerThreadLifecycleObserver> m_lifecycleObserver;
- const BlinkGC::ThreadHeapMode m_threadHeapMode;
};
-INSTANTIATE_TEST_CASE_P(MainThreadHeap,
- WorkerThreadTest,
- ::testing::Values(BlinkGC::MainThreadHeapMode));
-
-INSTANTIATE_TEST_CASE_P(PerThreadHeap,
- WorkerThreadTest,
- ::testing::Values(BlinkGC::PerThreadHeapMode));
-
-TEST_P(WorkerThreadTest, ShouldScheduleToTerminateExecution) {
+TEST_F(WorkerThreadTest, ShouldScheduleToTerminateExecution) {
using ThreadState = WorkerThread::ThreadState;
MutexLocker dummyLock(m_workerThread->m_threadStateMutex);
@@ -151,7 +141,7 @@ TEST_P(WorkerThreadTest, ShouldScheduleToTerminateExecution) {
m_workerThread->setExitCode(dummyLock, ExitCode::GracefullyTerminated);
}
-TEST_P(WorkerThreadTest, AsyncTerminate_OnIdle) {
+TEST_F(WorkerThreadTest, AsyncTerminate_OnIdle) {
expectReportingCalls();
start();
@@ -167,7 +157,7 @@ TEST_P(WorkerThreadTest, AsyncTerminate_OnIdle) {
EXPECT_EQ(ExitCode::GracefullyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest, SyncTerminate_OnIdle) {
+TEST_F(WorkerThreadTest, SyncTerminate_OnIdle) {
expectReportingCalls();
start();
@@ -179,7 +169,7 @@ TEST_P(WorkerThreadTest, SyncTerminate_OnIdle) {
EXPECT_EQ(ExitCode::SyncForciblyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest, AsyncTerminate_ImmediatelyAfterStart) {
+TEST_F(WorkerThreadTest, AsyncTerminate_ImmediatelyAfterStart) {
expectReportingCallsForWorkerPossiblyTerminatedBeforeInitialization();
start();
@@ -190,7 +180,7 @@ TEST_P(WorkerThreadTest, AsyncTerminate_ImmediatelyAfterStart) {
EXPECT_EQ(ExitCode::GracefullyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest, SyncTerminate_ImmediatelyAfterStart) {
+TEST_F(WorkerThreadTest, SyncTerminate_ImmediatelyAfterStart) {
expectReportingCallsForWorkerPossiblyTerminatedBeforeInitialization();
start();
@@ -210,7 +200,7 @@ TEST_P(WorkerThreadTest, SyncTerminate_ImmediatelyAfterStart) {
ExitCode::SyncForciblyTerminated == exitCode);
}
-TEST_P(WorkerThreadTest, AsyncTerminate_WhileTaskIsRunning) {
+TEST_F(WorkerThreadTest, AsyncTerminate_WhileTaskIsRunning) {
const long long kForcibleTerminationDelayInMs = 10;
setForcibleTerminationDelayInMs(kForcibleTerminationDelayInMs);
@@ -234,7 +224,7 @@ TEST_P(WorkerThreadTest, AsyncTerminate_WhileTaskIsRunning) {
EXPECT_EQ(ExitCode::AsyncForciblyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest, SyncTerminate_WhileTaskIsRunning) {
+TEST_F(WorkerThreadTest, SyncTerminate_WhileTaskIsRunning) {
expectReportingCallsForWorkerForciblyTerminated();
startWithSourceCodeNotToFinish();
m_reportingProxy->waitUntilScriptEvaluation();
@@ -244,7 +234,7 @@ TEST_P(WorkerThreadTest, SyncTerminate_WhileTaskIsRunning) {
EXPECT_EQ(ExitCode::SyncForciblyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest,
+TEST_F(WorkerThreadTest,
AsyncTerminateAndThenSyncTerminate_WhileTaskIsRunning) {
const long long kForcibleTerminationDelayInMs = 10;
setForcibleTerminationDelayInMs(kForcibleTerminationDelayInMs);
@@ -264,7 +254,7 @@ TEST_P(WorkerThreadTest,
EXPECT_EQ(ExitCode::SyncForciblyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest, Terminate_WhileDebuggerTaskIsRunningOnInitialization) {
+TEST_F(WorkerThreadTest, Terminate_WhileDebuggerTaskIsRunningOnInitialization) {
EXPECT_CALL(*m_reportingProxy, didCreateWorkerGlobalScope(_)).Times(1);
EXPECT_CALL(*m_reportingProxy, didInitializeWorkerContext()).Times(1);
EXPECT_CALL(*m_reportingProxy, willDestroyWorkerGlobalScope()).Times(1);
@@ -324,7 +314,7 @@ TEST_P(WorkerThreadTest, Terminate_WhileDebuggerTaskIsRunningOnInitialization) {
EXPECT_EQ(ExitCode::GracefullyTerminated, getExitCode());
}
-TEST_P(WorkerThreadTest, Terminate_WhileDebuggerTaskIsRunning) {
+TEST_F(WorkerThreadTest, Terminate_WhileDebuggerTaskIsRunning) {
expectReportingCalls();
start();
m_workerThread->waitForInit();

Powered by Google App Engine
This is Rietveld 408576698