| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/sync/test/integration/preferences_helper.h" | 10 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 ChangeStringPref(1, prefs::kHomePage, "http://www.google.com/1"); | 69 ChangeStringPref(1, prefs::kHomePage, "http://www.google.com/1"); |
| 70 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); | 70 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); |
| 71 EXPECT_EQ("http://www.google.com/1", GetPrefs(0)->GetString(prefs::kHomePage))
; | 71 EXPECT_EQ("http://www.google.com/1", GetPrefs(0)->GetString(prefs::kHomePage))
; |
| 72 } | 72 } |
| 73 | 73 |
| 74 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, UnsyncableBooleanPref) { | 74 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, UnsyncableBooleanPref) { |
| 75 ASSERT_TRUE(SetupSync()); | 75 ASSERT_TRUE(SetupSync()); |
| 76 DisableVerifier(); | 76 DisableVerifier(); |
| 77 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); | 77 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); |
| 78 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kCheckDefaultBrowser)); | 78 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kDisableScreenshots)); |
| 79 | 79 |
| 80 // This pref is not syncable. | 80 // This pref is not syncable. |
| 81 ChangeBooleanPref(0, prefs::kCheckDefaultBrowser); | 81 ChangeBooleanPref(0, prefs::kDisableScreenshots); |
| 82 | 82 |
| 83 // This pref is syncable. | 83 // This pref is syncable. |
| 84 ChangeStringPref(0, prefs::kHomePage, "http://news.google.com"); | 84 ChangeStringPref(0, prefs::kHomePage, "http://news.google.com"); |
| 85 | 85 |
| 86 // Wait until the syncable pref is synced, then expect that the non-syncable | 86 // Wait until the syncable pref is synced, then expect that the non-syncable |
| 87 // one is still out of sync. | 87 // one is still out of sync. |
| 88 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); | 88 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); |
| 89 ASSERT_FALSE(BooleanPrefMatches(prefs::kCheckDefaultBrowser)); | 89 ASSERT_FALSE(BooleanPrefMatches(prefs::kDisableScreenshots)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, StringPref) { | 92 IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, StringPref) { |
| 93 ASSERT_TRUE(SetupSync()); | 93 ASSERT_TRUE(SetupSync()); |
| 94 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); | 94 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); |
| 95 | 95 |
| 96 ChangeStringPref(0, prefs::kHomePage, "http://news.google.com"); | 96 ChangeStringPref(0, prefs::kHomePage, "http://news.google.com"); |
| 97 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); | 97 ASSERT_TRUE(AwaitStringPrefMatches(prefs::kHomePage)); |
| 98 } | 98 } |
| 99 | 99 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); | 137 ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); |
| 138 ASSERT_TRUE(EnableEncryption(0)); | 138 ASSERT_TRUE(EnableEncryption(0)); |
| 139 ASSERT_TRUE(EnableEncryption(1)); | 139 ASSERT_TRUE(EnableEncryption(1)); |
| 140 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kHomePageIsNewTabPage)); | 140 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kHomePageIsNewTabPage)); |
| 141 | 141 |
| 142 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); | 142 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); |
| 143 ChangeBooleanPref(0, prefs::kShowHomeButton); | 143 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 144 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); | 144 ASSERT_TRUE(AwaitBooleanPrefMatches(prefs::kShowHomeButton)); |
| 145 } | 145 } |
| OLD | NEW |