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

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

Issue 2627543002: ServiceWorker: Returns true for IsMojoForServiceWorkerEnabled (Closed)
Patch Set: 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/service_worker_dispatcher_host_unittest.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
index a40598601abb9add11f8931fdb1b6f6daed2d0a6..b4385433bf705a5e180a9d194b5d965da229893d 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
@@ -261,9 +261,6 @@ class ServiceWorkerDispatcherHostTest : public testing::Test {
ServiceWorkerProviderHost* provider_host_;
};
-class ServiceWorkerDispatcherHostTestP
- : public MojoServiceWorkerTestP<ServiceWorkerDispatcherHostTest> {};
-
class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient {
public:
ServiceWorkerTestContentBrowserClient() {}
@@ -276,7 +273,7 @@ class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient {
}
};
-TEST_P(ServiceWorkerDispatcherHostTestP,
+TEST_F(ServiceWorkerDispatcherHostTest,
Register_ContentSettingsDisallowsServiceWorker) {
ServiceWorkerTestContentBrowserClient test_browser_client;
ContentBrowserClient* old_browser_client =
@@ -310,7 +307,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
SetBrowserClientForTesting(old_browser_client);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_HTTPS) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_HTTPS) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -323,7 +320,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_HTTPS) {
ServiceWorkerMsg_ServiceWorkerRegistered::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_NonSecureTransportLocalhost) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_NonSecureTransportLocalhost) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -336,7 +333,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_NonSecureTransportLocalhost) {
ServiceWorkerMsg_ServiceWorkerRegistered::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_InvalidScopeShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_InvalidScopeShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -348,7 +345,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_InvalidScopeShouldFail) {
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_InvalidScriptShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_InvalidScriptShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -359,7 +356,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_InvalidScriptShouldFail) {
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_NonSecureOriginShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_NonSecureOriginShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -372,7 +369,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_NonSecureOriginShouldFail) {
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_CrossOriginShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_CrossOriginShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -416,7 +413,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_CrossOriginShouldFail) {
EXPECT_EQ(6, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, Register_BadCharactersShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_BadCharactersShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -448,8 +445,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, Register_BadCharactersShouldFail) {
EXPECT_EQ(6, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
- Register_FileSystemDocumentShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, Register_FileSystemDocumentShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -472,7 +468,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
EXPECT_EQ(3, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
+TEST_F(ServiceWorkerDispatcherHostTest,
Register_FileSystemScriptOrScopeShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
@@ -496,7 +492,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
EXPECT_EQ(3, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, EarlyContextDeletion) {
+TEST_F(ServiceWorkerDispatcherHostTest, EarlyContextDeletion) {
helper_->ShutdownContext();
// Let the shutdown reach the simulated IO thread.
@@ -508,7 +504,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, EarlyContextDeletion) {
ServiceWorkerMsg_ServiceWorkerRegistrationError::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, ProviderCreatedAndDestroyed) {
+TEST_F(ServiceWorkerDispatcherHostTest, ProviderCreatedAndDestroyed) {
const int kProviderId = 1001;
int process_id = helper_->mock_render_process_id();
@@ -543,7 +539,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, ProviderCreatedAndDestroyed) {
EXPECT_FALSE(context()->GetProviderHost(process_id, kProviderId));
}
-TEST_P(ServiceWorkerDispatcherHostTestP, GetRegistration_SameOrigin) {
+TEST_F(ServiceWorkerDispatcherHostTest, GetRegistration_SameOrigin) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -555,8 +551,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, GetRegistration_SameOrigin) {
ServiceWorkerMsg_DidGetRegistration::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
- GetRegistration_CrossOriginShouldFail) {
+TEST_F(ServiceWorkerDispatcherHostTest, GetRegistration_CrossOriginShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -567,7 +562,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
+TEST_F(ServiceWorkerDispatcherHostTest,
GetRegistration_InvalidScopeShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
@@ -579,7 +574,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
+TEST_F(ServiceWorkerDispatcherHostTest,
GetRegistration_NonSecureOriginShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
@@ -591,7 +586,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, GetRegistration_EarlyContextDeletion) {
+TEST_F(ServiceWorkerDispatcherHostTest, GetRegistration_EarlyContextDeletion) {
helper_->ShutdownContext();
// Let the shutdown reach the simulated IO thread.
@@ -602,7 +597,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, GetRegistration_EarlyContextDeletion) {
ServiceWorkerMsg_ServiceWorkerGetRegistrationError::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, GetRegistrations_SecureOrigin) {
+TEST_F(ServiceWorkerDispatcherHostTest, GetRegistrations_SecureOrigin) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
CreateServiceWorkerProviderHost(kProviderId));
@@ -612,7 +607,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, GetRegistrations_SecureOrigin) {
GetRegistrations(kProviderId, ServiceWorkerMsg_DidGetRegistrations::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
+TEST_F(ServiceWorkerDispatcherHostTest,
GetRegistrations_NonSecureOriginShouldFail) {
const int64_t kProviderId = 99; // Dummy value
std::unique_ptr<ServiceWorkerProviderHost> host(
@@ -624,8 +619,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP,
- GetRegistrations_EarlyContextDeletion) {
+TEST_F(ServiceWorkerDispatcherHostTest, GetRegistrations_EarlyContextDeletion) {
helper_->ShutdownContext();
// Let the shutdown reach the simulated IO thread.
@@ -634,7 +628,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP,
GetRegistrations(-1, ServiceWorkerMsg_ServiceWorkerGetRegistrationsError::ID);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, CleanupOnRendererCrash) {
+TEST_F(ServiceWorkerDispatcherHostTest, CleanupOnRendererCrash) {
GURL pattern = GURL("http://www.example.com/");
GURL script_url = GURL("http://www.example.com/service_worker.js");
int process_id = helper_->mock_render_process_id();
@@ -679,7 +673,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, CleanupOnRendererCrash) {
EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, DispatchExtendableMessageEvent) {
+TEST_F(ServiceWorkerDispatcherHostTest, DispatchExtendableMessageEvent) {
GURL pattern = GURL("http://www.example.com/");
GURL script_url = GURL("http://www.example.com/service_worker.js");
@@ -745,7 +739,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, DispatchExtendableMessageEvent) {
EXPECT_EQ(remaining_time, version_->remaining_timeout());
}
-TEST_P(ServiceWorkerDispatcherHostTestP, DispatchExtendableMessageEvent_Fail) {
+TEST_F(ServiceWorkerDispatcherHostTest, DispatchExtendableMessageEvent_Fail) {
GURL pattern = GURL("http://www.example.com/");
GURL script_url = GURL("http://www.example.com/service_worker.js");
@@ -773,7 +767,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, DispatchExtendableMessageEvent_Fail) {
EXPECT_FALSE(MessagePortService::GetInstance()->AreMessagesHeld(port));
}
-TEST_P(ServiceWorkerDispatcherHostTestP, OnSetHostedVersionId) {
+TEST_F(ServiceWorkerDispatcherHostTest, OnSetHostedVersionId) {
GURL pattern = GURL("http://www.example.com/");
GURL script_url = GURL("http://www.example.com/service_worker.js");
@@ -801,7 +795,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, OnSetHostedVersionId) {
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, OnSetHostedVersionId_DetachedWorker) {
+TEST_F(ServiceWorkerDispatcherHostTest, OnSetHostedVersionId_DetachedWorker) {
GURL pattern = GURL("http://www.example.com/");
GURL script_url = GURL("http://www.example.com/service_worker.js");
@@ -829,7 +823,7 @@ TEST_P(ServiceWorkerDispatcherHostTestP, OnSetHostedVersionId_DetachedWorker) {
EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_);
}
-TEST_P(ServiceWorkerDispatcherHostTestP, ReceivedTimedOutRequestResponse) {
+TEST_F(ServiceWorkerDispatcherHostTest, ReceivedTimedOutRequestResponse) {
GURL pattern = GURL("https://www.example.com/");
GURL script_url = GURL("https://www.example.com/service_worker.js");
@@ -856,8 +850,4 @@ TEST_P(ServiceWorkerDispatcherHostTestP, ReceivedTimedOutRequestResponse) {
EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_);
}
-INSTANTIATE_TEST_CASE_P(ServiceWorkerDispatcherHostTest,
- ServiceWorkerDispatcherHostTestP,
- testing::Bool());
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698