| 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, helper_->context()->AsWeakPtr(), | 110 SERVICE_WORKER_PROVIDER_FOR_WINDOW, |
| 111 dispatcher_host_.get())); | 111 ServiceWorkerProviderHost::FrameSecurityLevel::SECURE, |
| 112 helper_->context()->AsWeakPtr(), dispatcher_host_.get())); |
| 112 | 113 |
| 113 helper_->SimulateAddProcessToPattern(pattern, | 114 helper_->SimulateAddProcessToPattern(pattern, |
| 114 helper_->mock_render_process_id()); | 115 helper_->mock_render_process_id()); |
| 115 } | 116 } |
| 116 | 117 |
| 117 void TearDown() override { | 118 void TearDown() override { |
| 118 dispatcher_host_ = NULL; | 119 dispatcher_host_ = NULL; |
| 119 registration_ = NULL; | 120 registration_ = NULL; |
| 120 version_ = NULL; | 121 version_ = NULL; |
| 121 provider_host_.reset(); | 122 provider_host_.reset(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 VerifyStateChangedMessage(handle->handle_id(), | 166 VerifyStateChangedMessage(handle->handle_id(), |
| 166 blink::WebServiceWorkerStateInstalling, | 167 blink::WebServiceWorkerStateInstalling, |
| 167 ipc_sink()->GetMessageAt(1)); | 168 ipc_sink()->GetMessageAt(1)); |
| 168 // 3. StateChanged (state == Installed). | 169 // 3. StateChanged (state == Installed). |
| 169 VerifyStateChangedMessage(handle->handle_id(), | 170 VerifyStateChangedMessage(handle->handle_id(), |
| 170 blink::WebServiceWorkerStateInstalled, | 171 blink::WebServiceWorkerStateInstalled, |
| 171 ipc_sink()->GetMessageAt(2)); | 172 ipc_sink()->GetMessageAt(2)); |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace content | 175 } // namespace content |
| OLD | NEW |