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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler_unittest.cc

Issue 14691004: [sync] Separate sign in from sync on Desktop Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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: chrome/browser/ui/webui/sync_setup_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
index c6c9c195686aa8ffa141d00edaf8ed68f64fd71f..d34b04306fd950a96521b1e2aa29f83aa5039d06 100644
--- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc
@@ -58,7 +58,8 @@ syncer::ModelTypeSet GetAllTypes() {
enum SyncAllDataConfig {
SYNC_ALL_DATA,
- CHOOSE_WHAT_TO_SYNC
+ CHOOSE_WHAT_TO_SYNC,
+ SYNC_NOTHING
};
enum EncryptAllConfig {
@@ -78,6 +79,7 @@ std::string GetConfiguration(const DictionaryValue* extra_values,
if (extra_values)
result.MergeDictionary(extra_values);
result.SetBoolean("syncAllDataTypes", sync_all == SYNC_ALL_DATA);
+ result.SetBoolean("syncNothing", sync_all == SYNC_NOTHING);
result.SetBoolean("encryptAllData", encrypt_all == ENCRYPT_ALL_DATA);
result.SetBoolean("usePassphrase", !passphrase.empty());
if (!passphrase.empty())
@@ -182,6 +184,7 @@ void CheckConfigDataTypeArguments(DictionaryValue* dictionary,
SyncAllDataConfig config,
syncer::ModelTypeSet types) {
CheckBool(dictionary, "syncAllDataTypes", config == SYNC_ALL_DATA);
+ CheckBool(dictionary, "syncNothing", config == SYNC_NOTHING);
CheckBool(dictionary, "appsSynced", types.Has(syncer::APPS));
CheckBool(dictionary, "autofillSynced", types.Has(syncer::AUTOFILL));
CheckBool(dictionary, "bookmarksSynced", types.Has(syncer::BOOKMARKS));
@@ -924,6 +927,20 @@ TEST_P(SyncSetupHandlerTest, TestSyncEverything) {
ExpectDone();
}
+TEST_P(SyncSetupHandlerTest, TestSyncNothing) {
+ std::string args = GetConfiguration(
+ NULL, SYNC_NOTHING, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS);
+ ListValue list_args;
+ list_args.Append(new StringValue(args));
+ EXPECT_CALL(*mock_pss_, DisableForUser());
+ SetupInitializedProfileSyncService();
+ handler_->HandleConfigure(&list_args);
+
+ // Ensure that the sync setup dialog was closed.
+ const TestWebUI::CallData& data = web_ui_.call_data()[0];
+ EXPECT_EQ("OptionsPage.closeOverlay", data.function_name);
+}
+
TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) {
std::string args = GetConfiguration(
NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_ALL_DATA);

Powered by Google App Engine
This is Rietveld 408576698