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

Unified Diff: components/invalidation/sync_system_resources_unittest.cc

Issue 348503002: Report InvalidatorState correctly from GCMNetworkChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@GCM.ConnectionState
Patch Set: Fix SyncNetworkChannelTest Created 6 years, 6 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
« no previous file with comments | « components/invalidation/sync_system_resources.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/invalidation/sync_system_resources_unittest.cc
diff --git a/components/invalidation/sync_system_resources_unittest.cc b/components/invalidation/sync_system_resources_unittest.cc
index 705ba0b8ea6f18881c130416f9cd219b6c542f39..d264b606a4a670790ca24c82f4b38349fc10af5d 100644
--- a/components/invalidation/sync_system_resources_unittest.cc
+++ b/components/invalidation/sync_system_resources_unittest.cc
@@ -181,7 +181,8 @@ class TestSyncNetworkChannel : public SyncNetworkChannel {
TestSyncNetworkChannel() {}
virtual ~TestSyncNetworkChannel() {}
- using SyncNetworkChannel::NotifyStateChange;
+ using SyncNetworkChannel::NotifyNetworkStatusChange;
+ using SyncNetworkChannel::NotifyChannelStateChange;
using SyncNetworkChannel::DeliverIncomingMessage;
virtual void SendMessage(const std::string& message) OVERRIDE {
@@ -233,15 +234,21 @@ class SyncNetworkChannelTest
bool connected_;
};
-// Simulate network channel state change. It should propagate to observer.
-TEST_F(SyncNetworkChannelTest, OnNetworkChannelStateChanged) {
+// Simulate channel state change. It should propagate to observer.
+TEST_F(SyncNetworkChannelTest, ChannelStateChange) {
EXPECT_EQ(DEFAULT_INVALIDATION_ERROR, last_invalidator_state_);
- EXPECT_FALSE(connected_);
- network_channel_.NotifyStateChange(INVALIDATIONS_ENABLED);
+ network_channel_.NotifyChannelStateChange(INVALIDATIONS_ENABLED);
EXPECT_EQ(INVALIDATIONS_ENABLED, last_invalidator_state_);
- EXPECT_TRUE(connected_);
- network_channel_.NotifyStateChange(INVALIDATION_CREDENTIALS_REJECTED);
+ network_channel_.NotifyChannelStateChange(INVALIDATION_CREDENTIALS_REJECTED);
EXPECT_EQ(INVALIDATION_CREDENTIALS_REJECTED, last_invalidator_state_);
+}
+
+// Simulate network state change. It should propagate to cacheinvalidations.
+TEST_F(SyncNetworkChannelTest, NetworkStateChange) {
+ EXPECT_FALSE(connected_);
+ network_channel_.NotifyNetworkStatusChange(true);
+ EXPECT_TRUE(connected_);
+ network_channel_.NotifyNetworkStatusChange(false);
EXPECT_FALSE(connected_);
}
« no previous file with comments | « components/invalidation/sync_system_resources.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698