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

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

Issue 147593006: Refine error code returned by ServiceWorkerVersion::StartWorker (e.g. PROCESS_NOT_FOUND etc) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 a08809f680b84855d161c6cc996aba46c3eb0777..7e3662436775e2e8ce24c5b0202b22a452c3ea55 100644
--- a/content/browser/service_worker/embedded_worker_instance_unittest.cc
+++ b/content/browser/service_worker/embedded_worker_instance_unittest.cc
@@ -55,14 +55,16 @@ TEST_F(EmbeddedWorkerInstanceTest, StartAndStop) {
const GURL url("http://example.com/worker.js");
// This fails as we have no available process yet.
- EXPECT_FALSE(worker->Start(service_worker_version_id, url));
+ EXPECT_EQ(SERVICE_WORKER_ERROR_PROCESS_NOT_FOUND,
+ worker->Start(service_worker_version_id, url));
EXPECT_EQ(EmbeddedWorkerInstance::STOPPED, worker->status());
// Simulate adding one process to the worker.
helper_->SimulateAddProcess(embedded_worker_id, process_id);
// Start should succeed.
- EXPECT_TRUE(worker->Start(service_worker_version_id, url));
+ EXPECT_EQ(SERVICE_WORKER_OK,
+ worker->Start(service_worker_version_id, url));
EXPECT_EQ(EmbeddedWorkerInstance::STARTING, worker->status());
base::RunLoop().RunUntilIdle();
@@ -71,7 +73,7 @@ TEST_F(EmbeddedWorkerInstanceTest, StartAndStop) {
EXPECT_EQ(process_id, worker->process_id());
// Stop the worker.
- EXPECT_TRUE(worker->Stop());
+ EXPECT_EQ(SERVICE_WORKER_OK, worker->Stop());
EXPECT_EQ(EmbeddedWorkerInstance::STOPPING, worker->status());
base::RunLoop().RunUntilIdle();
@@ -101,7 +103,8 @@ TEST_F(EmbeddedWorkerInstanceTest, ChooseProcess) {
helper_->SimulateAddProcess(embedded_worker_id, 3);
// Process 3 has the biggest # of references and it should be chosen.
- EXPECT_TRUE(worker->Start(1L, GURL("http://example.com/worker.js")));
+ EXPECT_EQ(SERVICE_WORKER_OK,
+ worker->Start(1L, GURL("http://example.com/worker.js")));
EXPECT_EQ(EmbeddedWorkerInstance::STARTING, worker->status());
EXPECT_EQ(3, worker->process_id());
« no previous file with comments | « content/browser/service_worker/embedded_worker_instance.cc ('k') | content/browser/service_worker/embedded_worker_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698