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

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

Issue 1515153003: Enable chrome://gcm-internals on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 GCMStatsRecorderImpl recorder_; 343 GCMStatsRecorderImpl recorder_;
344 }; 344 };
345 345
346 GCMStatsRecorderImplTest::GCMStatsRecorderImplTest(){ 346 GCMStatsRecorderImplTest::GCMStatsRecorderImplTest(){
347 } 347 }
348 348
349 GCMStatsRecorderImplTest::~GCMStatsRecorderImplTest() {} 349 GCMStatsRecorderImplTest::~GCMStatsRecorderImplTest() {}
350 350
351 void GCMStatsRecorderImplTest::SetUp(){ 351 void GCMStatsRecorderImplTest::SetUp(){
352 source_ = "s1,s2"; 352 source_ = "s1,s2";
353 recorder_.SetRecording(true); 353 recorder_.set_is_recording(true);
354 } 354 }
355 355
356 TEST_F(GCMStatsRecorderImplTest, StartStopRecordingTest) { 356 TEST_F(GCMStatsRecorderImplTest, StartStopRecordingTest) {
357 EXPECT_TRUE(recorder_.is_recording()); 357 EXPECT_TRUE(recorder_.is_recording());
358 recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec); 358 recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec);
359 VerifyRecordedSendingCount(1); 359 VerifyRecordedSendingCount(1);
360 VerifyDataSentToWire("1st call"); 360 VerifyDataSentToWire("1st call");
361 361
362 recorder_.SetRecording(false); 362 recorder_.set_is_recording(false);
363 EXPECT_FALSE(recorder_.is_recording()); 363 EXPECT_FALSE(recorder_.is_recording());
364 recorder_.Clear(); 364 recorder_.Clear();
365 VerifyAllActivityQueueEmpty("all cleared"); 365 VerifyAllActivityQueueEmpty("all cleared");
366 366
367 // Exercise every recording method below and verify that nothing is recorded. 367 // Exercise every recording method below and verify that nothing is recorded.
368 recorder_.RecordCheckinInitiated(kAndroidId); 368 recorder_.RecordCheckinInitiated(kAndroidId);
369 recorder_.RecordCheckinDelayedDueToBackoff(kDelay); 369 recorder_.RecordCheckinDelayedDueToBackoff(kDelay);
370 recorder_.RecordCheckinSuccess(); 370 recorder_.RecordCheckinSuccess();
371 recorder_.RecordCheckinFailure(kCheckinStatus, true); 371 recorder_.RecordCheckinFailure(kCheckinStatus, true);
372 VerifyAllActivityQueueEmpty("no checkin"); 372 VerifyAllActivityQueueEmpty("no checkin");
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 recorder_.RecordIncomingSendError(kAppId, kReceiverId, kMessageId); 518 recorder_.RecordIncomingSendError(kAppId, kReceiverId, kMessageId);
519 VerifyRecordedSendingCount(3); 519 VerifyRecordedSendingCount(3);
520 VerifyIncomingSendError("3rd call"); 520 VerifyIncomingSendError("3rd call");
521 521
522 recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec); 522 recorder_.RecordDataSentToWire(kAppId, kReceiverId, kMessageId, kQueuedSec);
523 VerifyRecordedSendingCount(4); 523 VerifyRecordedSendingCount(4);
524 VerifyDataSentToWire("4th call"); 524 VerifyDataSentToWire("4th call");
525 } 525 }
526 526
527 } // namespace gcm 527 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_impl.cc ('k') | components/gcm_driver/resources/gcm_internals.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698