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

Unified Diff: chrome/browser/invalidation/gcm_invalidation_bridge_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 | « no previous file | components/invalidation/gcm_invalidation_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc
diff --git a/chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc b/chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc
index b263baa768aedfbbe148f15ca9f715550cd33cfc..f44cef8b65efa6e962b99c45cbb98fc5035e72ac 100644
--- a/chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc
+++ b/chrome/browser/invalidation/gcm_invalidation_bridge_unittest.cc
@@ -47,8 +47,7 @@ class CustomFakeGCMDriver : public gcm::FakeGCMDriver {
class GCMInvalidationBridgeTest : public ::testing::Test {
protected:
GCMInvalidationBridgeTest()
- : connection_state_(
- syncer::GCMNetworkChannelDelegate::CONNECTION_STATE_OFFLINE) {}
+ : connection_online_(false) {}
virtual ~GCMInvalidationBridgeTest() {}
@@ -92,9 +91,8 @@ class GCMInvalidationBridgeTest : public ::testing::Test {
request_token_errors_.push_back(error);
}
- void ConnectionStateChanged(
- syncer::GCMNetworkChannelDelegate::ConnectionState connection_state) {
- connection_state_ = connection_state;
+ void ConnectionStateChanged(bool online) {
+ connection_online_ = online;
}
content::TestBrowserThreadBundle thread_bundle_;
@@ -105,7 +103,7 @@ class GCMInvalidationBridgeTest : public ::testing::Test {
std::vector<std::string> issued_tokens_;
std::vector<GoogleServiceAuthError> request_token_errors_;
std::string registration_id_;
- syncer::GCMNetworkChannelDelegate::ConnectionState connection_state_;
+ bool connection_online_;
scoped_ptr<GCMInvalidationBridge> bridge_;
scoped_ptr<syncer::GCMNetworkChannelDelegate> delegate_;
@@ -154,16 +152,13 @@ TEST_F(GCMInvalidationBridgeTest, Register) {
}
TEST_F(GCMInvalidationBridgeTest, ConnectionState) {
- EXPECT_EQ(syncer::GCMNetworkChannelDelegate::CONNECTION_STATE_OFFLINE,
- connection_state_);
+ EXPECT_FALSE(connection_online_);
bridge_->OnConnected(net::IPEndPoint());
RunLoop();
- EXPECT_EQ(syncer::GCMNetworkChannelDelegate::CONNECTION_STATE_ONLINE,
- connection_state_);
+ EXPECT_TRUE(connection_online_);
bridge_->OnDisconnected();
RunLoop();
- EXPECT_EQ(syncer::GCMNetworkChannelDelegate::CONNECTION_STATE_OFFLINE,
- connection_state_);
+ EXPECT_FALSE(connection_online_);
}
} // namespace
« no previous file with comments | « no previous file | components/invalidation/gcm_invalidation_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698