| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/values.h" | 5 #include "base/values.h" |
| 6 #include "chrome/browser/sync/test/integration/preferences_helper.h" | 6 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
| 7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 9 #include "chrome/browser/translate/translate_prefs.h" | 9 #include "chrome/browser/translate/translate_prefs.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // TCM ID - 3661290. | 82 // TCM ID - 3661290. |
| 83 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, DisablePreferences) { | 83 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, DisablePreferences) { |
| 84 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 84 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 85 DisableVerifier(); | 85 DisableVerifier(); |
| 86 | 86 |
| 87 ASSERT_TRUE(BooleanPrefMatches(prefs::kSyncPreferences)); | 87 ASSERT_TRUE(BooleanPrefMatches(prefs::kSyncPreferences)); |
| 88 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); | 88 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); |
| 89 | 89 |
| 90 GetClient(1)->DisableSyncForDatatype(syncer::PREFERENCES); | 90 GetClient(1)->DisableSyncForDatatype(syncer::PREFERENCES); |
| 91 ChangeBooleanPref(0, prefs::kPasswordManagerEnabled); | 91 ChangeBooleanPref(0, prefs::kPasswordManagerEnabled); |
| 92 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); | 92 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); |
| 93 ASSERT_FALSE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); | 93 ASSERT_FALSE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); |
| 94 | 94 |
| 95 GetClient(1)->EnableSyncForDatatype(syncer::PREFERENCES); | 95 GetClient(1)->EnableSyncForDatatype(syncer::PREFERENCES); |
| 96 ASSERT_TRUE(AwaitQuiescence()); | 96 ASSERT_TRUE(AwaitQuiescence()); |
| 97 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); | 97 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // TCM ID - 3664292. | 100 // TCM ID - 3664292. |
| 101 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, DisableSync) { | 101 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, DisableSync) { |
| 102 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 102 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 103 DisableVerifier(); | 103 DisableVerifier(); |
| 104 | 104 |
| 105 ASSERT_TRUE(BooleanPrefMatches(prefs::kSyncPreferences)); | 105 ASSERT_TRUE(BooleanPrefMatches(prefs::kSyncPreferences)); |
| 106 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); | 106 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); |
| 107 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 107 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 108 | 108 |
| 109 GetClient(1)->DisableSyncForAllDatatypes(); | 109 GetClient(1)->DisableSyncForAllDatatypes(); |
| 110 ChangeBooleanPref(0, prefs::kPasswordManagerEnabled); | 110 ChangeBooleanPref(0, prefs::kPasswordManagerEnabled); |
| 111 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion()); | 111 ASSERT_TRUE(GetClient(0)->AwaitCommitActivityCompletion()); |
| 112 ASSERT_FALSE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); | 112 ASSERT_FALSE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); |
| 113 | 113 |
| 114 ChangeBooleanPref(1, prefs::kShowHomeButton); | 114 ChangeBooleanPref(1, prefs::kShowHomeButton); |
| 115 ASSERT_FALSE(BooleanPrefMatches(prefs::kShowHomeButton)); | 115 ASSERT_FALSE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 116 | 116 |
| 117 GetClient(1)->EnableSyncForAllDatatypes(); | 117 GetClient(1)->EnableSyncForAllDatatypes(); |
| 118 ASSERT_TRUE(AwaitQuiescence()); | 118 ASSERT_TRUE(AwaitQuiescence()); |
| 119 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); | 119 ASSERT_TRUE(BooleanPrefMatches(prefs::kPasswordManagerEnabled)); |
| 120 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 120 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 121 } | 121 } |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 587 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 588 ASSERT_TRUE(IsEncryptionComplete(0)); | 588 ASSERT_TRUE(IsEncryptionComplete(0)); |
| 589 ASSERT_TRUE(IsEncryptionComplete(1)); | 589 ASSERT_TRUE(IsEncryptionComplete(1)); |
| 590 ASSERT_TRUE(BooleanPrefMatches(prefs::kHomePageIsNewTabPage)); | 590 ASSERT_TRUE(BooleanPrefMatches(prefs::kHomePageIsNewTabPage)); |
| 591 | 591 |
| 592 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 592 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 593 ChangeBooleanPref(0, prefs::kShowHomeButton); | 593 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 594 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 594 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 595 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 595 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 596 } | 596 } |
| OLD | NEW |