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

Side by Side Diff: components/gcm_driver/gcm_client_impl_unittest.cc

Issue 409653004: Record latencies of connection and arrival of first message in UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes test failures. Created 6 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
« no previous file with comments | « no previous file | components/gcm_driver/gcm_stats_recorder_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/gcm_driver/gcm_client_impl.h" 5 #include "components/gcm_driver/gcm_client_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 464 }
465 465
466 void GCMClientImplTest::StartGCMClient() { 466 void GCMClientImplTest::StartGCMClient() {
467 // Start loading and check-in. 467 // Start loading and check-in.
468 gcm_client_->Start(); 468 gcm_client_->Start();
469 469
470 PumpLoopUntilIdle(); 470 PumpLoopUntilIdle();
471 } 471 }
472 472
473 void GCMClientImplTest::ReceiveMessageFromMCS(const MCSMessage& message) { 473 void GCMClientImplTest::ReceiveMessageFromMCS(const MCSMessage& message) {
474 gcm_client_->recorder_.RecordConnectionInitiated(std::string());
475 gcm_client_->recorder_.RecordConnectionSuccess();
474 gcm_client_->OnMessageReceivedFromMCS(message); 476 gcm_client_->OnMessageReceivedFromMCS(message);
475 } 477 }
476 478
477 void GCMClientImplTest::OnGCMReady() { 479 void GCMClientImplTest::OnGCMReady() {
478 last_event_ = LOADING_COMPLETED; 480 last_event_ = LOADING_COMPLETED;
479 QuitLoop(); 481 QuitLoop();
480 } 482 }
481 483
482 void GCMClientImplTest::OnMessageReceived( 484 void GCMClientImplTest::OnMessageReceived(
483 const std::string& registration_id, 485 const std::string& registration_id,
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) { 973 TEST_F(GCMClientImplStartAndStopTest, StartStopAndRestartImmediately) {
972 // Start the GCM and then stop and restart it immediately. 974 // Start the GCM and then stop and restart it immediately.
973 gcm_client()->Start(); 975 gcm_client()->Start();
974 gcm_client()->Stop(); 976 gcm_client()->Stop();
975 gcm_client()->Start(); 977 gcm_client()->Start();
976 978
977 PumpLoopUntilIdle(); 979 PumpLoopUntilIdle();
978 } 980 }
979 981
980 } // namespace gcm 982 } // namespace gcm
OLDNEW
« no previous file with comments | « no previous file | components/gcm_driver/gcm_stats_recorder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698