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

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: diff from https://codereview.chromium.org/2249063004/#ps40001 Created 4 years, 4 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 819
819 // Set the worker status to STOPPING. 820 // Set the worker status to STOPPING.
820 version_->embedded_worker()->Stop(); 821 version_->embedded_worker()->Stop();
821 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, version_->running_status()); 822 EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, version_->running_status());
822 823
823 // 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
824 // not increase. 825 // not increase.
825 const int kRequestId = 91; // Dummy value 826 const int kRequestId = 91; // Dummy value
826 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse( 827 dispatcher_host_->OnMessageReceived(ServiceWorkerHostMsg_FetchEventResponse(
827 version_->embedded_worker()->embedded_worker_id(), kRequestId, 828 version_->embedded_worker()->embedded_worker_id(), kRequestId,
828 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse())); 829 SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK, ServiceWorkerResponse(),
830 base::Time::Now()));
829 831
830 base::RunLoop().RunUntilIdle(); 832 base::RunLoop().RunUntilIdle();
831 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_); 833 EXPECT_EQ(0, dispatcher_host_->bad_messages_received_count_);
832 } 834 }
833 835
834 } // namespace content 836 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698