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