Commit bbe31010 authored by gangwu's avatar gangwu Committed by Commit bot

Do not let the invalidations service to fall back to XMPP if GCM is disabled,...

Do not let the invalidations service to fall back to XMPP if GCM is disabled, since we already finished traansite from GCM to XMPP, and XMPP do not have prepare for such load spike.
Since Sync have backoff mechanism, so if GCM server some how disabled, sync will retry it later.

BUG=479300

Review URL: https://codereview.chromium.org/1127393005

Cr-Commit-Position: refs/heads/master@{#330564}
parent 86f3cf9e
......@@ -33,11 +33,6 @@ TiclProfileSettingsProvider::~TiclProfileSettingsProvider() {
}
bool TiclProfileSettingsProvider::UseGCMChannel() const {
if (!gcm::GCMProfileService::IsGCMEnabled(profile_)) {
// Do not try to use GCM channel if GCM is disabled.
return false;
}
if (profile_->GetPrefs()->GetBoolean(
prefs::kInvalidationServiceUseGCMChannel)) {
// Use GCM channel if it was enabled via prefs.
......
......@@ -92,16 +92,16 @@ TEST_F(TiclProfileSettingsProviderTest, ChannelSelectionTest) {
prefs->SetBoolean(prefs::kInvalidationServiceUseGCMChannel, true);
EXPECT_EQ(TiclInvalidationService::GCM_NETWORK_CHANNEL, GetNetworkChannel());
// If invalidation channel setting says use GCM but GCM is not enabled, do not
// fall back to push channel.
prefs->SetBoolean(gcm::prefs::kGCMChannelStatus, false);
prefs->SetBoolean(prefs::kInvalidationServiceUseGCMChannel, true);
EXPECT_EQ(TiclInvalidationService::GCM_NETWORK_CHANNEL, GetNetworkChannel());
// If invalidation channel setting is set to false, fall back to push channel.
prefs->SetBoolean(gcm::prefs::kGCMChannelStatus, true);
prefs->SetBoolean(prefs::kInvalidationServiceUseGCMChannel, false);
EXPECT_EQ(TiclInvalidationService::PUSH_CLIENT_CHANNEL, GetNetworkChannel());
// If invalidation channel setting says use GCM but GCM is not enabled, fall
// back to push channel.
prefs->SetBoolean(gcm::prefs::kGCMChannelStatus, false);
prefs->SetBoolean(prefs::kInvalidationServiceUseGCMChannel, true);
EXPECT_EQ(TiclInvalidationService::PUSH_CLIENT_CHANNEL, GetNetworkChannel());
}
} // namespace invalidation
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment