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

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

Issue 2251633002: Use tri-state enum for the existence of Fetch Handler in ServiceWorkerVersion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/status/existence/ Created 4 years, 4 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/service_worker_controllee_request_handler_unittest.cc
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
index ef10ba48af85fbbca9a387baa525522c7f0ecf6f..4e94eb7f927362fc20e41ced3652dc53b11684e9 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc
@@ -171,8 +171,9 @@ TEST_F(ServiceWorkerControlleeRequestHandlerTest, DisallowServiceWorker) {
SetBrowserClientForTesting(&test_browser_client);
// Store an activated worker.
+ version_->set_fetch_handler_existence(
+ ServiceWorkerVersion::FetchHandlerExistence::EXISTS);
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
- version_->set_has_fetch_handler(true);
registration_->SetActiveVersion(version_);
context()->storage()->StoreRegistration(
registration_.get(),
@@ -200,8 +201,9 @@ TEST_F(ServiceWorkerControlleeRequestHandlerTest, DisallowServiceWorker) {
TEST_F(ServiceWorkerControlleeRequestHandlerTest, ActivateWaitingVersion) {
// Store a registration that is installed but not activated yet.
+ version_->set_fetch_handler_existence(
+ ServiceWorkerVersion::FetchHandlerExistence::EXISTS);
version_->SetStatus(ServiceWorkerVersion::INSTALLED);
- version_->set_has_fetch_handler(true);
registration_->SetWaitingVersion(version_);
context()->storage()->StoreRegistration(
registration_.get(),
@@ -235,7 +237,8 @@ TEST_F(ServiceWorkerControlleeRequestHandlerTest, ActivateWaitingVersion) {
TEST_F(ServiceWorkerControlleeRequestHandlerTest, InstallingRegistration) {
// Create an installing registration.
version_->SetStatus(ServiceWorkerVersion::INSTALLING);
- version_->set_has_fetch_handler(true);
+ version_->set_fetch_handler_existence(
+ ServiceWorkerVersion::FetchHandlerExistence::EXISTS);
registration_->SetInstallingVersion(version_);
context()->storage()->NotifyInstallingRegistration(registration_.get());
@@ -260,8 +263,9 @@ TEST_F(ServiceWorkerControlleeRequestHandlerTest, InstallingRegistration) {
TEST_F(ServiceWorkerControlleeRequestHandlerTest, DeletedProviderHost) {
// Store a registration so the call to FindRegistrationForDocument will read
// from the database.
+ version_->set_fetch_handler_existence(
+ ServiceWorkerVersion::FetchHandlerExistence::EXISTS);
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
- version_->set_has_fetch_handler(true);
registration_->SetActiveVersion(version_);
context()->storage()->StoreRegistration(
registration_.get(),
@@ -290,8 +294,9 @@ TEST_F(ServiceWorkerControlleeRequestHandlerTest, DeletedProviderHost) {
}
TEST_F(ServiceWorkerControlleeRequestHandlerTest, FallbackWithNoFetchHandler) {
+ version_->set_fetch_handler_existence(
+ ServiceWorkerVersion::FetchHandlerExistence::DOES_NOT_EXIST);
version_->SetStatus(ServiceWorkerVersion::ACTIVATED);
- version_->set_has_fetch_handler(false);
registration_->SetActiveVersion(version_);
context()->storage()->StoreRegistration(
registration_.get(), version_.get(),

Powered by Google App Engine
This is Rietveld 408576698