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

Unified Diff: components/gcm_driver/gcm_stats_recorder_android_unittest.cc

Issue 1616113003: List message decryption failures on chrome://gcm-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after CL 1619053003 Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/gcm_driver/gcm_stats_recorder_android_unittest.cc
diff --git a/components/gcm_driver/gcm_stats_recorder_android_unittest.cc b/components/gcm_driver/gcm_stats_recorder_android_unittest.cc
index 0be010c92f404e3d8c712159f2146bba903eae4a..addca7437443807c36fc26da22d3969cf235bff5 100644
--- a/components/gcm_driver/gcm_stats_recorder_android_unittest.cc
+++ b/components/gcm_driver/gcm_stats_recorder_android_unittest.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include "components/gcm_driver/crypto/gcm_encryption_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace gcm {
@@ -55,16 +56,22 @@ TEST_F(GCMStatsRecorderAndroidTest, RecordsAndCallsDelegate) {
recorder.RecordDataMessageReceived(kTestAppId, 42 /* message_byte_size */);
EXPECT_EQ(5u, activity_recorded_calls());
+ recorder.RecordDecryptionFailure(
+ kTestAppId, GCMEncryptionProvider::DECRYPTION_FAILURE_INVALID_PAYLOAD);
+ EXPECT_EQ(6u, activity_recorded_calls());
+
RecordedActivities activities;
recorder.CollectActivities(&activities);
EXPECT_EQ(4u, activities.registration_activities.size());
EXPECT_EQ(1u, activities.receiving_activities.size());
+ EXPECT_EQ(1u, activities.decryption_failure_activities.size());
recorder.CollectActivities(&activities);
EXPECT_EQ(8u, activities.registration_activities.size());
EXPECT_EQ(2u, activities.receiving_activities.size());
+ EXPECT_EQ(2u, activities.decryption_failure_activities.size());
recorder.Clear();
@@ -73,6 +80,7 @@ TEST_F(GCMStatsRecorderAndroidTest, RecordsAndCallsDelegate) {
EXPECT_EQ(0u, empty_activities.registration_activities.size());
EXPECT_EQ(0u, empty_activities.receiving_activities.size());
+ EXPECT_EQ(0u, empty_activities.decryption_failure_activities.size());
}
TEST_F(GCMStatsRecorderAndroidTest, NullDelegate) {
« no previous file with comments | « components/gcm_driver/gcm_stats_recorder_android.cc ('k') | components/gcm_driver/gcm_stats_recorder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698