OLD | NEW |
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 content::MockResourceContext resource_context_; | 126 content::MockResourceContext resource_context_; |
127 scoped_ptr<EmbeddedWorkerTestHelper> helper_; | 127 scoped_ptr<EmbeddedWorkerTestHelper> helper_; |
128 scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; | 128 scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; |
129 }; | 129 }; |
130 | 130 |
131 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { | 131 class ServiceWorkerTestContentBrowserClient : public TestContentBrowserClient { |
132 public: | 132 public: |
133 ServiceWorkerTestContentBrowserClient() {} | 133 ServiceWorkerTestContentBrowserClient() {} |
134 virtual bool AllowServiceWorker(const GURL& scope, | 134 virtual bool AllowServiceWorker(const GURL& scope, |
135 const GURL& first_party, | 135 const GURL& first_party, |
136 content::ResourceContext* context) OVERRIDE { | 136 content::ResourceContext* context) override { |
137 return false; | 137 return false; |
138 } | 138 } |
139 }; | 139 }; |
140 | 140 |
141 TEST_F(ServiceWorkerDispatcherHostTest, | 141 TEST_F(ServiceWorkerDispatcherHostTest, |
142 Register_ContentSettingsDisallowsServiceWorker) { | 142 Register_ContentSettingsDisallowsServiceWorker) { |
143 ServiceWorkerTestContentBrowserClient test_browser_client; | 143 ServiceWorkerTestContentBrowserClient test_browser_client; |
144 ContentBrowserClient* old_browser_client = | 144 ContentBrowserClient* old_browser_client = |
145 SetBrowserClientForTesting(&test_browser_client); | 145 SetBrowserClientForTesting(&test_browser_client); |
146 | 146 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 // Let the shutdown reach the simulated IO thread. | 378 // Let the shutdown reach the simulated IO thread. |
379 base::RunLoop().RunUntilIdle(); | 379 base::RunLoop().RunUntilIdle(); |
380 | 380 |
381 GetRegistration(-1, | 381 GetRegistration(-1, |
382 GURL(), | 382 GURL(), |
383 ServiceWorkerMsg_ServiceWorkerGetRegistrationError::ID); | 383 ServiceWorkerMsg_ServiceWorkerGetRegistrationError::ID); |
384 } | 384 } |
385 | 385 |
386 } // namespace content | 386 } // namespace content |
OLD | NEW |