OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/browser/service_worker/embedded_worker_registry.h" | 9 #include "content/browser/service_worker/embedded_worker_registry.h" |
10 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 10 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; | 99 ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; |
100 helper_->context()->storage()->StoreRegistration( | 100 helper_->context()->storage()->StoreRegistration( |
101 registration_.get(), | 101 registration_.get(), |
102 version_.get(), | 102 version_.get(), |
103 CreateReceiverOnCurrentThread(&status)); | 103 CreateReceiverOnCurrentThread(&status)); |
104 base::RunLoop().RunUntilIdle(); | 104 base::RunLoop().RunUntilIdle(); |
105 ASSERT_EQ(SERVICE_WORKER_OK, status); | 105 ASSERT_EQ(SERVICE_WORKER_OK, status); |
106 | 106 |
107 provider_host_.reset(new ServiceWorkerProviderHost( | 107 provider_host_.reset(new ServiceWorkerProviderHost( |
108 helper_->mock_render_process_id(), kRenderFrameId, 1, | 108 helper_->mock_render_process_id(), kRenderFrameId, 1, |
109 SERVICE_WORKER_PROVIDER_FOR_WINDOW, helper_->context()->AsWeakPtr(), | 109 SERVICE_WORKER_PROVIDER_FOR_WINDOW, |
110 dispatcher_host_.get())); | 110 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE, |
| 111 helper_->context()->AsWeakPtr(), dispatcher_host_.get())); |
111 | 112 |
112 helper_->SimulateAddProcessToPattern(pattern, | 113 helper_->SimulateAddProcessToPattern(pattern, |
113 helper_->mock_render_process_id()); | 114 helper_->mock_render_process_id()); |
114 } | 115 } |
115 | 116 |
116 void TearDown() override { | 117 void TearDown() override { |
117 dispatcher_host_ = NULL; | 118 dispatcher_host_ = NULL; |
118 registration_ = NULL; | 119 registration_ = NULL; |
119 version_ = NULL; | 120 version_ = NULL; |
120 provider_host_.reset(); | 121 provider_host_.reset(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 VerifyStateChangedMessage(handle->handle_id(), | 165 VerifyStateChangedMessage(handle->handle_id(), |
165 blink::WebServiceWorkerStateInstalling, | 166 blink::WebServiceWorkerStateInstalling, |
166 ipc_sink()->GetMessageAt(1)); | 167 ipc_sink()->GetMessageAt(1)); |
167 // 3. StateChanged (state == Installed). | 168 // 3. StateChanged (state == Installed). |
168 VerifyStateChangedMessage(handle->handle_id(), | 169 VerifyStateChangedMessage(handle->handle_id(), |
169 blink::WebServiceWorkerStateInstalled, | 170 blink::WebServiceWorkerStateInstalled, |
170 ipc_sink()->GetMessageAt(2)); | 171 ipc_sink()->GetMessageAt(2)); |
171 } | 172 } |
172 | 173 |
173 } // namespace content | 174 } // namespace content |
OLD | NEW |