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