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

Unified Diff: content/browser/service_worker/embedded_worker_instance_unittest.cc

Issue 2578023002: ServiceWorker: Stop don't send a message before connection established (Closed)
Patch Set: Reset starting_phase when releasing the process Created 3 years, 11 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: content/browser/service_worker/embedded_worker_instance_unittest.cc
diff --git a/content/browser/service_worker/embedded_worker_instance_unittest.cc b/content/browser/service_worker/embedded_worker_instance_unittest.cc
index 60efd265cb8d1b4148bb4bbba2ee778bf4d05785..723f6f1e94818f12ff3b81f9fa2a3bee366b281c 100644
--- a/content/browser/service_worker/embedded_worker_instance_unittest.cc
+++ b/content/browser/service_worker/embedded_worker_instance_unittest.cc
@@ -221,7 +221,7 @@ TEST_P(EmbeddedWorkerInstanceTestP, StartAndStop) {
EXPECT_EQ(helper_->mock_render_process_id(), worker->process_id());
// Stop the worker.
- EXPECT_EQ(SERVICE_WORKER_OK, worker->Stop());
+ EXPECT_TRUE(worker->Stop());
EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, worker->status());
base::RunLoop().RunUntilIdle();
@@ -283,7 +283,7 @@ TEST_P(EmbeddedWorkerInstanceTestP, ForceNewProcess) {
// The worker should be using the default render process.
EXPECT_EQ(helper_->mock_render_process_id(), worker->process_id());
- EXPECT_EQ(SERVICE_WORKER_OK, worker->Stop());
+ EXPECT_TRUE(worker->Stop());
base::RunLoop().RunUntilIdle();
}
@@ -309,7 +309,7 @@ TEST_P(EmbeddedWorkerInstanceTestP, ForceNewProcess) {
EXPECT_EQ(EmbeddedWorkerStatus::RUNNING, worker->status());
// The worker should be using the new render process.
EXPECT_EQ(helper_->new_render_process_id(), worker->process_id());
- EXPECT_EQ(SERVICE_WORKER_OK, worker->Stop());
+ EXPECT_TRUE(worker->Stop());
base::RunLoop().RunUntilIdle();
}
}
@@ -354,7 +354,7 @@ TEST_P(EmbeddedWorkerInstanceTestP, StopWhenDevToolsAttached) {
// Calling Stop() actually stops the worker regardless of whether devtools
// is attached or not.
- EXPECT_EQ(SERVICE_WORKER_OK, worker->Stop());
+ EXPECT_TRUE(worker->Stop());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(EmbeddedWorkerStatus::STOPPED, worker->status());
}
@@ -520,13 +520,7 @@ TEST_P(EmbeddedWorkerInstanceTestP, StopDuringProcessAllocation) {
// "PROCESS_ALLOCATED" event should not be recorded.
ASSERT_EQ(1u, events_.size());
EXPECT_EQ(DETACHED, events_[0].type);
- if (is_mojo_enabled()) {
- // STOPPING should be recorded here because EmbeddedWorkerInstance must be
- // detached while executing RunUntilIdle.
- EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, events_[0].status);
- } else {
- EXPECT_EQ(EmbeddedWorkerStatus::STARTING, events_[0].status);
- }
+ EXPECT_EQ(EmbeddedWorkerStatus::STARTING, events_[0].status);
events_.clear();
// Restart the worker.

Powered by Google App Engine
This is Rietveld 408576698