| 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/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.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_integration_test_util.h" | 8 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
| 9 #include "chrome/browser/sync/test/integration/sync_test.h" | 9 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 | 11 |
| 12 using preferences_helper::AwaitBooleanPrefMatches; | 12 using preferences_helper::AwaitBooleanPrefMatches; |
| 13 using preferences_helper::AwaitIntegerPrefMatches; | 13 using preferences_helper::AwaitIntegerPrefMatches; |
| 14 using preferences_helper::AwaitListPrefMatches; | 14 using preferences_helper::AwaitListPrefMatches; |
| 15 using preferences_helper::AwaitStringPrefMatches; | 15 using preferences_helper::AwaitStringPrefMatches; |
| 16 using preferences_helper::BooleanPrefMatches; | 16 using preferences_helper::BooleanPrefMatches; |
| 17 using preferences_helper::ChangeBooleanPref; | 17 using preferences_helper::ChangeBooleanPref; |
| 18 using preferences_helper::ChangeIntegerPref; | 18 using preferences_helper::ChangeIntegerPref; |
| 19 using preferences_helper::ChangeListPref; | 19 using preferences_helper::ChangeListPref; |
| 20 using preferences_helper::ChangeStringPref; | 20 using preferences_helper::ChangeStringPref; |
| 21 using preferences_helper::GetPrefs; | 21 using preferences_helper::GetPrefs; |
| 22 | 22 |
| 23 class TwoClientPreferencesSyncTest : public SyncTest { | 23 class TwoClientPreferencesSyncTest : public SyncTest { |
| 24 public: | 24 public: |
| 25 TwoClientPreferencesSyncTest() : SyncTest(TWO_CLIENT) {} | 25 TwoClientPreferencesSyncTest() : SyncTest(TWO_CLIENT) {} |
| 26 virtual ~TwoClientPreferencesSyncTest() {} | 26 ~TwoClientPreferencesSyncTest() override {} |
| 27 | 27 |
| 28 bool TestUsesSelfNotifications() override { return false; } | 28 bool TestUsesSelfNotifications() override { return false; } |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 DISALLOW_COPY_AND_ASSIGN(TwoClientPreferencesSyncTest); | 31 DISALLOW_COPY_AND_ASSIGN(TwoClientPreferencesSyncTest); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, BooleanPref) { | 34 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, BooleanPref) { |
| 35 ASSERT_TRUE(SetupSync()); | 35 ASSERT_TRUE(SetupSync()); |
| 36 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kHomePageIsNewTabPage)); | 36 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kHomePageIsNewTabPage)); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); | 147 ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); |
| 148 ASSERT_TRUE(EnableEncryption(0)); | 148 ASSERT_TRUE(EnableEncryption(0)); |
| 149 ASSERT_TRUE(EnableEncryption(1)); | 149 ASSERT_TRUE(EnableEncryption(1)); |
| 150 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kHomePageIsNewTabPage)); | 150 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kHomePageIsNewTabPage)); |
| 151 | 151 |
| 152 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); | 152 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); |
| 153 ChangeBooleanPref(0, prefs::kShowHomeButton); | 153 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 154 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); | 154 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); |
| 155 } | 155 } |
| OLD | NEW |