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

Unified Diff: components/ntp_snippets/ntp_snippets_status_service_unittest.cc

Issue 2191343002: 📰 Remove SnippetService's dependency on Sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update some doc, show NO_SNIPPETS instead of SIGNIN when during INITIALIZING state Created 4 years, 5 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/ntp_snippets/ntp_snippets_status_service.cc ('k') | components/ntp_snippets_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_status_service_unittest.cc
diff --git a/components/ntp_snippets/ntp_snippets_status_service_unittest.cc b/components/ntp_snippets/ntp_snippets_status_service_unittest.cc
index 10e4ba1f97c659e0a3ae0743ec6b21d61e135a07..6b3c8cfa7605ff6ee8904f413f0278a2facc5cce 100644
--- a/components/ntp_snippets/ntp_snippets_status_service_unittest.cc
+++ b/components/ntp_snippets/ntp_snippets_status_service_unittest.cc
@@ -14,7 +14,6 @@
#include "components/signin/core/browser/fake_signin_manager.h"
#include "components/signin/core/browser/test_signin_client.h"
#include "components/signin/core/common/signin_pref_names.h"
-#include "components/sync_driver/fake_sync_service.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -31,8 +30,8 @@ class NTPSnippetsStatusServiceTest : public test::NTPSnippetsTestBase {
void SetUp() override {
test::NTPSnippetsTestBase::SetUp();
- service_.reset(new NTPSnippetsStatusService(
- fake_signin_manager(), mock_sync_service(), pref_service()));
+ service_.reset(
+ new NTPSnippetsStatusService(fake_signin_manager(), pref_service()));
}
protected:
@@ -42,34 +41,13 @@ class NTPSnippetsStatusServiceTest : public test::NTPSnippetsTestBase {
std::unique_ptr<NTPSnippetsStatusService> service_;
};
-TEST_F(NTPSnippetsStatusServiceTest, SyncStateCompatibility) {
+TEST_F(NTPSnippetsStatusServiceTest, SigninStateCompatibility) {
// The default test setup is signed out.
EXPECT_EQ(DisabledReason::SIGNED_OUT, service()->GetDisabledReasonFromDeps());
- // Once signed in, we should be in a compatible sync state.
+ // Once signed in, we should be in a compatible state.
fake_signin_manager()->SignIn("foo@bar.com");
EXPECT_EQ(DisabledReason::NONE, service()->GetDisabledReasonFromDeps());
-
- // History sync disabled.
- mock_sync_service()->active_data_types_ = syncer::ModelTypeSet();
- EXPECT_EQ(DisabledReason::HISTORY_SYNC_DISABLED,
- service()->GetDisabledReasonFromDeps());
-
- // Encryption enabled.
- mock_sync_service()->is_encrypt_everything_enabled_ = true;
- EXPECT_EQ(DisabledReason::PASSPHRASE_ENCRYPTION_ENABLED,
- service()->GetDisabledReasonFromDeps());
-
- // Not done loading.
- mock_sync_service()->configuration_done_ = false;
- mock_sync_service()->active_data_types_ = syncer::ModelTypeSet();
- EXPECT_EQ(DisabledReason::HISTORY_SYNC_STATE_UNKNOWN,
- service()->GetDisabledReasonFromDeps());
-
- // Sync disabled.
- mock_sync_service()->can_sync_start_ = false;
- EXPECT_EQ(DisabledReason::SYNC_DISABLED,
- service()->GetDisabledReasonFromDeps());
}
TEST_F(NTPSnippetsStatusServiceTest, DisabledViaPref) {
@@ -85,22 +63,6 @@ TEST_F(NTPSnippetsStatusServiceTest, DisabledViaPref) {
fake_signin_manager()->SignIn("foo@bar.com");
EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED,
service()->GetDisabledReasonFromDeps());
-
- mock_sync_service()->active_data_types_ = syncer::ModelTypeSet();
- EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED,
- service()->GetDisabledReasonFromDeps());
-
- mock_sync_service()->is_encrypt_everything_enabled_ = true;
- EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED,
- service()->GetDisabledReasonFromDeps());
-
- mock_sync_service()->configuration_done_ = false;
- EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED,
- service()->GetDisabledReasonFromDeps());
-
- mock_sync_service()->can_sync_start_ = false;
- EXPECT_EQ(DisabledReason::EXPLICITLY_DISABLED,
- service()->GetDisabledReasonFromDeps());
}
} // namespace ntp_snippets
« no previous file with comments | « components/ntp_snippets/ntp_snippets_status_service.cc ('k') | components/ntp_snippets_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698