| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id); | 92 registry()->OnWorkerStopped(worker->process_id(), embedded_worker_id); |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 class ServiceWorkerDispatcherHostTest : public testing::Test { | 96 class ServiceWorkerDispatcherHostTest : public testing::Test { |
| 97 protected: | 97 protected: |
| 98 ServiceWorkerDispatcherHostTest() | 98 ServiceWorkerDispatcherHostTest() |
| 99 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) {} | 99 : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) {} |
| 100 | 100 |
| 101 void SetUp() override { | 101 void SetUp() override { |
| 102 Initialize( | 102 Initialize(base::MakeUnique<EmbeddedWorkerTestHelper>(base::FilePath())); |
| 103 base::WrapUnique(new EmbeddedWorkerTestHelper(base::FilePath()))); | |
| 104 } | 103 } |
| 105 | 104 |
| 106 void TearDown() override { | 105 void TearDown() override { |
| 107 version_ = nullptr; | 106 version_ = nullptr; |
| 108 registration_ = nullptr; | 107 registration_ = nullptr; |
| 109 helper_.reset(); | 108 helper_.reset(); |
| 110 } | 109 } |
| 111 | 110 |
| 112 ServiceWorkerContextCore* context() { return helper_->context(); } | 111 ServiceWorkerContextCore* context() { return helper_->context(); } |
| 113 ServiceWorkerContextWrapper* context_wrapper() { | 112 ServiceWorkerContextWrapper* context_wrapper() { |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( | 827 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( |
| 829 version_->embedded_worker()->embedded_worker_id(), kRequestId, | 828 version_->embedded_worker()->embedded_worker_id(), kRequestId, |
| 830 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(), | 829 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(), |
| 831 base::Time::Now())); | 830 base::Time::Now())); |
| 832 | 831 |
| 833 base::RunLoop().RunUntilIdle(); | 832 base::RunLoop().RunUntilIdle(); |
| 834 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); | 833 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); |
| 835 } | 834 } |
| 836 | 835 |
| 837 } // namespace content | 836 } // namespace content |
| OLD | NEW |