Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: content/browser/service_worker/service_worker_dispatcher_host_unittest.cc

Issue 2218943002: Introduce ServiceWorker.EventDispatchingDelay UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated mpearson@'s comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "base/time/time.h"
15 #include "content/browser/browser_thread_impl.h" 16 #include "content/browser/browser_thread_impl.h"
16 #include "content/browser/message_port_service.h" 17 #include "content/browser/message_port_service.h"
17 #include "content/browser/service_worker/embedded_worker_instance.h" 18 #include "content/browser/service_worker/embedded_worker_instance.h"
18 #include "content/browser/service_worker/embedded_worker_registry.h" 19 #include "content/browser/service_worker/embedded_worker_registry.h"
19 #include "content/browser/service_worker/embedded_worker_status.h" 20 #include "content/browser/service_worker/embedded_worker_status.h"
20 #include "content/browser/service_worker/embedded_worker_test_helper.h" 21 #include "content/browser/service_worker/embedded_worker_test_helper.h"
21 #include "content/browser/service_worker/service_worker_context_core.h" 22 #include "content/browser/service_worker/service_worker_context_core.h"
22 #include "content/browser/service_worker/service_worker_context_wrapper.h" 23 #include "content/browser/service_worker/service_worker_context_wrapper.h"
23 #include "content/browser/service_worker/service_worker_handle.h" 24 #include "content/browser/service_worker/service_worker_handle.h"
24 #include "content/common/service_worker/embedded_worker_messages.h" 25 #include "content/common/service_worker/embedded_worker_messages.h"
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 820
820 // Set the worker status to STOPPING. 821 // Set the worker status to STOPPING.
821 version_->embedded_worker()->Stop(); 822 version_->embedded_worker()->Stop();
822 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, version_->running_status()); 823 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, version_->running_status());
823 824
824 // Receive a response for a timed out request. The bad message count should 825 // Receive a response for a timed out request. The bad message count should
825 // not increase. 826 // not increase.
826 const int kRequestId = 91; // Dummy value 827 const int kRequestId = 91; // Dummy value
827 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( 828 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse(
828 version_->embedded_worker()->embedded_worker_id(), kRequestId, 829 version_->embedded_worker()->embedded_worker_id(), kRequestId,
829 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse())); 830 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(),
831 base::Time::Now()));
830 832
831 base::RunLoop().RunUntilIdle(); 833 base::RunLoop().RunUntilIdle();
832 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); 834 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_);
833 } 835 }
834 836
835 } // namespace content 837 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698