| OLD | NEW | 
|---|
| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 93 static const char kNotifySendStatusEvent[] = "SEND status: QUEUED"; | 93 static const char kNotifySendStatusEvent[] = "SEND status: QUEUED"; | 
| 94 static const char kNotifySendStatusDetails[] = "Msg size: 99 bytes, TTL: 7"; | 94 static const char kNotifySendStatusDetails[] = "Msg size: 99 bytes, TTL: 7"; | 
| 95 static const char kIncomingSendErrorEvent[] = "Received 'send error' msg"; | 95 static const char kIncomingSendErrorEvent[] = "Received 'send error' msg"; | 
| 96 static const char kIncomingSendErrorDetails[] = ""; | 96 static const char kIncomingSendErrorDetails[] = ""; | 
| 97 | 97 | 
| 98 }  // namespace | 98 }  // namespace | 
| 99 | 99 | 
| 100 class GCMStatsRecorderImplTest : public testing::Test { | 100 class GCMStatsRecorderImplTest : public testing::Test { | 
| 101  public: | 101  public: | 
| 102   GCMStatsRecorderImplTest(); | 102   GCMStatsRecorderImplTest(); | 
| 103   virtual ~GCMStatsRecorderImplTest(); | 103   ~GCMStatsRecorderImplTest() override; | 
| 104   virtual void SetUp() override; | 104   void SetUp() override; | 
| 105 | 105 | 
| 106   void VerifyRecordedCheckinCount(int expected_count) { | 106   void VerifyRecordedCheckinCount(int expected_count) { | 
| 107     EXPECT_EQ(expected_count, | 107     EXPECT_EQ(expected_count, | 
| 108               static_cast<int>(recorder_.checkin_activities().size())); | 108               static_cast<int>(recorder_.checkin_activities().size())); | 
| 109   } | 109   } | 
| 110   void VerifyRecordedConnectionCount(int expected_count) { | 110   void VerifyRecordedConnectionCount(int expected_count) { | 
| 111     EXPECT_EQ(expected_count, | 111     EXPECT_EQ(expected_count, | 
| 112               static_cast<int>(recorder_.connection_activities().size())); | 112               static_cast<int>(recorder_.connection_activities().size())); | 
| 113   } | 113   } | 
| 114   void VerifyRecordedRegistrationCount(int expected_count) { | 114   void VerifyRecordedRegistrationCount(int expected_count) { | 
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 516   recorder_.RecordIncomingSendError(kAppId, kReceiverId, kMessageId); | 516   recorder_.RecordIncomingSendError(kAppId, kReceiverId, kMessageId); | 
| 517   VerifyRecordedSendingCount(3); | 517   VerifyRecordedSendingCount(3); | 
| 518   VerifyIncomingSendError("3rd call"); | 518   VerifyIncomingSendError("3rd call"); | 
| 519 | 519 | 
| 520   recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec); | 520   recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec); | 
| 521   VerifyRecordedSendingCount(4); | 521   VerifyRecordedSendingCount(4); | 
| 522   VerifyDataSentToWire("4th call"); | 522   VerifyDataSentToWire("4th call"); | 
| 523 } | 523 } | 
| 524 | 524 | 
| 525 }  // namespace gcm | 525 }  // namespace gcm | 
| OLD | NEW | 
|---|