| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 version_->StartWorker(ServiceWorkerMetrics::EventType::UNKNOWN, | 816 version_->StartWorker(ServiceWorkerMetrics::EventType::UNKNOWN, |
| 817 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 817 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
| 818 base::RunLoop().RunUntilIdle(); | 818 base::RunLoop().RunUntilIdle(); |
| 819 | 819 |
| 820 // Set the worker status to STOPPING. | 820 // Set the worker status to STOPPING. |
| 821 version_->embedded_worker()->Stop(); | 821 version_->embedded_worker()->Stop(); |
| 822 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, version_->running_status()); | 822 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, version_->running_status()); |
| 823 | 823 |
| 824 // Receive a response for a timed out request. The bad message count should | 824 // Receive a response for a timed out request. The bad message count should |
| 825 // not increase. | 825 // not increase. |
| 826 const int kRequestId = 91; // Dummy value | 826 const int kFetchEventId = 91; // Dummy value |
| 827 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( | 827 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( |
| 828 version_->embedded_worker()->embedded_worker_id(), kRequestId, | 828 version_->embedded_worker()->embedded_worker_id(), kFetchEventId, |
| 829 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(), | 829 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(), |
| 830 base::Time::Now())); | 830 base::Time::Now())); |
| 831 | 831 |
| 832 base::RunLoop().RunUntilIdle(); | 832 base::RunLoop().RunUntilIdle(); |
| 833 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); | 833 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace content | 836 } // namespace content |
| OLD | NEW |