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

Side by Side Diff: components/gcm_driver/gcm_stats_recorder_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
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_stats_recorder_impl.h" 5 #include "components/gcm_driver/gcm_stats_recorder_impl.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 recorder_.RecordUnregistrationResponse(kAppId, kUnregistrationStatus); 478 recorder_.RecordUnregistrationResponse(kAppId, kUnregistrationStatus);
479 VerifyRecordedRegistrationCount(5); 479 VerifyRecordedRegistrationCount(5);
480 VerifyUnregistrationResponse("5th call"); 480 VerifyUnregistrationResponse("5th call");
481 481
482 recorder_.RecordUnregistrationRetryDelayed(kAppId, kDelay); 482 recorder_.RecordUnregistrationRetryDelayed(kAppId, kDelay);
483 VerifyRecordedRegistrationCount(6); 483 VerifyRecordedRegistrationCount(6);
484 VerifyUnregistrationRetryDelayed("6th call"); 484 VerifyUnregistrationRetryDelayed("6th call");
485 } 485 }
486 486
487 TEST_F(GCMStatsRecorderImplTest, RecordReceivingTest) { 487 TEST_F(GCMStatsRecorderImplTest, RecordReceivingTest) {
488 recorder_.RecordConnectionInitiated(std::string());
489 recorder_.RecordConnectionSuccess();
488 recorder_.RecordDataMessageReceived(kAppId, kFrom, kByteSize, true, 490 recorder_.RecordDataMessageReceived(kAppId, kFrom, kByteSize, true,
489 GCMStatsRecorder::DATA_MESSAGE); 491 GCMStatsRecorder::DATA_MESSAGE);
490 VerifyRecordedReceivingCount(1); 492 VerifyRecordedReceivingCount(1);
491 VerifyDataMessageReceived("1st call"); 493 VerifyDataMessageReceived("1st call");
492 494
493 recorder_.RecordDataMessageReceived(kAppId, kFrom, kByteSize, true, 495 recorder_.RecordDataMessageReceived(kAppId, kFrom, kByteSize, true,
494 GCMStatsRecorder::DELETED_MESSAGES); 496 GCMStatsRecorder::DELETED_MESSAGES);
495 VerifyRecordedReceivingCount(2); 497 VerifyRecordedReceivingCount(2);
496 VerifyDataDeletedMessage("2nd call"); 498 VerifyDataDeletedMessage("2nd call");
497 499
(...skipping 16 matching lines...) Expand all
514 recorder_.RecordIncomingSendError(kAppId, kReceiverId, kMessageId); 516 recorder_.RecordIncomingSendError(kAppId, kReceiverId, kMessageId);
515 VerifyRecordedSendingCount(3); 517 VerifyRecordedSendingCount(3);
516 VerifyIncomingSendError("3rd call"); 518 VerifyIncomingSendError("3rd call");
517 519
518 recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec); 520 recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec);
519 VerifyRecordedSendingCount(4); 521 VerifyRecordedSendingCount(4);
520 VerifyDataSentToWire("4th call"); 522 VerifyDataSentToWire("4th call");
521 } 523 }
522 524
523 } // namespace gcm 525 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698