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

Side by Side Diff: content/browser/service_worker/service_worker_dispatcher_host_unittest.cc

Issue 1110323005: Expose SW accesses in "Cookies set by this page" UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "content/browser/browser_thread_impl.h" 10 #include "content/browser/browser_thread_impl.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 content::MockResourceContext resource_context_; 141 content::MockResourceContext resource_context_;
142 scoped_ptr<EmbeddedWorkerTestHelper> helper_; 142 scoped_ptr<EmbeddedWorkerTestHelper> helper_;
143 scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; 143 scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_;
144 }; 144 };
145 145
146 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { 146 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient {
147 public: 147 public:
148 ServiceWorkerTestContentBrowserClient() {} 148 ServiceWorkerTestContentBrowserClient() {}
149 bool AllowServiceWorker(const GURL& scope, 149 bool AllowServiceWorker(const GURL& scope,
150 const GURL& first_party, 150 const GURL& first_party,
151 content::ResourceContext* context) override { 151 content::ResourceContext* context,
152 int render_process_id,
153 int render_frame_id) override {
152 return false; 154 return false;
153 } 155 }
154 }; 156 };
155 157
156 TEST_F(ServiceWorkerDispatcherHostTest, 158 TEST_F(ServiceWorkerDispatcherHostTest,
157 Register_ContentSettingsDisallowsServiceWorker) { 159 Register_ContentSettingsDisallowsServiceWorker) {
158 ServiceWorkerTestContentBrowserClient test_browser_client; 160 ServiceWorkerTestContentBrowserClient test_browser_client;
159 ContentBrowserClient* old_browser_client = 161 ContentBrowserClient* old_browser_client =
160 SetBrowserClientForTesting(&test_browser_client); 162 SetBrowserClientForTesting(&test_browser_client);
161 163
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 555
554 // To show the new dispatcher can operate, simulate provider creation. Since 556 // To show the new dispatcher can operate, simulate provider creation. Since
555 // the old dispatcher cleaned up the old provider host, the new one won't 557 // the old dispatcher cleaned up the old provider host, the new one won't
556 // complain. 558 // complain.
557 new_dispatcher_host->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated( 559 new_dispatcher_host->OnMessageReceived(ServiceWorkerHostMsg_ProviderCreated(
558 kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW)); 560 kProviderId, MSG_ROUTING_NONE, SERVICE_WORKER_PROVIDER_FOR_WINDOW));
559 EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_); 561 EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_);
560 } 562 }
561 563
562 } // namespace content 564 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_dispatcher_host.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698