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

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

Issue 1149383004: [3/5 chromium] Shows the clients which are controlled by ServiceWorker in DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 1fdb416ed20aa29411144b17ac4534c58ed21658..8f436e971f8212680666c0fe7144acd93a6dec46 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
@@ -131,9 +131,9 @@ class ServiceWorkerDispatcherHostTest : public testing::Test {
ServiceWorkerProviderHost* CreateServiceWorkerProviderHost(int provider_id) {
return new ServiceWorkerProviderHost(
- kRenderProcessId, kRenderFrameId, provider_id,
- SERVICE_WORKER_PROVIDER_FOR_WINDOW, context()->AsWeakPtr(),
- dispatcher_host_.get());
+ kRenderProcessId, kRenderFrameId,
+ MSG_ROUTING_NONE /* shared_worker_route_id */, provider_id,
+ context()->AsWeakPtr(), dispatcher_host_.get());
}
@@ -407,14 +407,15 @@ TEST_F(ServiceWorkerDispatcherHostTest, EarlyContextDeletion) {
TEST_F(ServiceWorkerDispatcherHostTest, ProviderCreatedAndDestroyed) {
const int kProviderId = 1001; // Test with a value != kRenderProcessId.
+ const int kRenderFrameId = 1;
dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated(
- kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW));
+ kProviderId, kRenderFrameId, MSG_ROUTING_NONE));
EXPECT_TRUE(context()->GetProviderHost(kRenderProcessId, kProviderId));
// Two with the same ID should be seen as a bad message.
dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated(
- kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW));
+ kProviderId, kRenderFrameId, MSG_ROUTING_NONE));
EXPECT_EQ(1, dispatcher_host_->bad_messages_received_count_);
dispatcher_host_->OnMessageReceived(
@@ -429,7 +430,7 @@ TEST_F(ServiceWorkerDispatcherHostTest, ProviderCreatedAndDestroyed) {
// Deletion of the dispatcher_host should cause providers for that
// process to get deleted as well.
dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated(
- kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW));
+ kProviderId, kRenderFrameId, MSG_ROUTING_NONE));
EXPECT_TRUE(context()->GetProviderHost(kRenderProcessId, kProviderId));
EXPECT_TRUE(dispatcher_host_->HasOneRef());
dispatcher_host_ = NULL;
@@ -497,8 +498,9 @@ TEST_F(ServiceWorkerDispatcherHostTest, GetRegistration_EarlyContextDeletion) {
TEST_F(ServiceWorkerDispatcherHostTest, CleanupOnRendererCrash) {
// Add a provider and worker.
const int64 kProviderId = 99; // Dummy value
+ const int64 kRenderFrameId = 1; // Dummy value
dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated(
- kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW));
+ kProviderId, kRenderFrameId, MSG_ROUTING_NONE));
GURL pattern = GURL("http://www.example.com/");
scoped_refptr<ServiceWorkerRegistration> registration(
@@ -561,7 +563,7 @@ TEST_F(ServiceWorkerDispatcherHostTest, CleanupOnRendererCrash) {
// the old dispatcher cleaned up the old provider host, the new one won't
// complain.
new_dispatcher_host->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated(
- kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW));
+ kProviderId, kRenderFrameId, MSG_ROUTING_NONE));
EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_);
}

Powered by Google App Engine
This is Rietveld 408576698