Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/prefs/scoped_user_pref_update.h" | 5 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
| 7 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/translate/translate_prefs.h" | 8 #include "chrome/browser/translate/translate_prefs.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/test/base/ui_test_utils.h" | 10 #include "chrome/test/base/ui_test_utils.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 public: | 126 public: |
| 127 MigrationErrorsTest() : LiveSyncTest(TWO_CLIENT) {} | 127 MigrationErrorsTest() : LiveSyncTest(TWO_CLIENT) {} |
| 128 virtual ~MigrationErrorsTest() {} | 128 virtual ~MigrationErrorsTest() {} |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 DISALLOW_COPY_AND_ASSIGN(MigrationErrorsTest); | 131 DISALLOW_COPY_AND_ASSIGN(MigrationErrorsTest); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 // Easiest possible test of migration errors: triggers a server migration on | 134 // Easiest possible test of migration errors: triggers a server migration on |
| 135 // one datatype, then modifies some other datatype. | 135 // one datatype, then modifies some other datatype. |
| 136 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, MigratePrefsThenModifyBookmark) { | 136 // TODO(akalin): Fails due to http://crbug.com/92928. |
| 137 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, | |
| 138 FAILS_MigratePrefsThenModifyBookmark) { | |
|
Nicolas Zea
2011/08/26 21:19:14
I'd kind of prefer this (and the other failing tes
akalin
2011/08/26 22:42:27
Done.
| |
| 137 if (!ServerSupportsErrorTriggering()) { | 139 if (!ServerSupportsErrorTriggering()) { |
| 138 LOG(WARNING) << "Test skipped in this server environment."; | 140 LOG(WARNING) << "Test skipped in this server environment."; |
| 139 return; | 141 return; |
| 140 } | 142 } |
| 141 | 143 |
| 142 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 144 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 143 | 145 |
| 144 // Phase 1: Before migrating anything, create & sync a preference. | 146 // Phase 1: Before migrating anything, create & sync a preference. |
| 145 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 147 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 146 ChangeBooleanPref(0, prefs::kShowHomeButton); | 148 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 158 | 160 |
| 159 // Phase 4: Verify that preferences can still be synchronized. | 161 // Phase 4: Verify that preferences can still be synchronized. |
| 160 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 162 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 161 ChangeBooleanPref(0, prefs::kShowHomeButton); | 163 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 162 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 164 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 163 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 165 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 164 } | 166 } |
| 165 | 167 |
| 166 // Triggers a server migration on two datatypes, then makes a local | 168 // Triggers a server migration on two datatypes, then makes a local |
| 167 // modification to one of them. | 169 // modification to one of them. |
| 170 // TODO(akalin): Fails due to http://crbug.com/92928. | |
| 168 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, | 171 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, |
| 169 MigratePrefsAndBookmarksThenModifyBookmark) { | 172 FAILS_MigratePrefsAndBookmarksThenModifyBookmark) { |
| 170 if (!ServerSupportsErrorTriggering()) { | 173 if (!ServerSupportsErrorTriggering()) { |
| 171 LOG(WARNING) << "Test skipped in this server environment."; | 174 LOG(WARNING) << "Test skipped in this server environment."; |
| 172 return; | 175 return; |
| 173 } | 176 } |
| 174 | 177 |
| 175 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 178 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 176 | 179 |
| 177 // Phase 1: Before migrating anything, create & sync a preference. | 180 // Phase 1: Before migrating anything, create & sync a preference. |
| 178 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 181 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 179 ChangeBooleanPref(0, prefs::kShowHomeButton); | 182 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 192 | 195 |
| 193 // Phase 4: Verify that preferences can still be synchronized. | 196 // Phase 4: Verify that preferences can still be synchronized. |
| 194 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 197 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 195 ChangeBooleanPref(0, prefs::kShowHomeButton); | 198 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 196 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 199 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 197 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 200 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 198 } | 201 } |
| 199 | 202 |
| 200 // Migrate every datatype in sequence; the catch being that the server | 203 // Migrate every datatype in sequence; the catch being that the server |
| 201 // will only tell the client about the migrations one at a time. | 204 // will only tell the client about the migrations one at a time. |
| 202 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, MigrationHellWithoutNigori) { | 205 // TODO(akalin): Fails due to http://crbug.com/92928. |
| 206 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, | |
| 207 FAILS_MigrationHellWithoutNigori) { | |
| 203 if (!ServerSupportsErrorTriggering()) { | 208 if (!ServerSupportsErrorTriggering()) { |
| 204 LOG(WARNING) << "Test skipped in this server environment."; | 209 LOG(WARNING) << "Test skipped in this server environment."; |
| 205 return; | 210 return; |
| 206 } | 211 } |
| 207 | 212 |
| 208 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 213 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 209 | 214 |
| 210 // Phase 1: Before migrating anything, create & sync a preference. | 215 // Phase 1: Before migrating anything, create & sync a preference. |
| 211 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 216 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 212 ChangeBooleanPref(0, prefs::kShowHomeButton); | 217 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 232 ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); | 237 ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); |
| 233 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 238 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 234 | 239 |
| 235 // Phase 4: Verify that preferences can still be synchronized. | 240 // Phase 4: Verify that preferences can still be synchronized. |
| 236 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 241 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 237 ChangeBooleanPref(0, prefs::kShowHomeButton); | 242 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 238 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 243 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 239 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 244 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 240 } | 245 } |
| 241 | 246 |
| 242 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, MigrationHellWithNigori) { | 247 // TODO(akalin): Fails due to http://crbug.com/92928. |
| 248 IN_PROC_BROWSER_TEST_F(MigrationErrorsTest, | |
| 249 FAILS_MigrationHellWithNigori) { | |
| 243 if (!ServerSupportsErrorTriggering()) { | 250 if (!ServerSupportsErrorTriggering()) { |
| 244 LOG(WARNING) << "Test skipped in this server environment."; | 251 LOG(WARNING) << "Test skipped in this server environment."; |
| 245 return; | 252 return; |
| 246 } | 253 } |
| 247 | 254 |
| 248 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 255 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 249 | 256 |
| 250 // Phase 1: Before migrating anything, create & sync a preference. | 257 // Phase 1: Before migrating anything, create & sync a preference. |
| 251 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 258 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 252 ChangeBooleanPref(0, prefs::kShowHomeButton); | 259 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 // Phase 5: Verify that preferences can still be synchronized. | 367 // Phase 5: Verify that preferences can still be synchronized. |
| 361 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 368 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 362 ChangeBooleanPref(0, prefs::kShowHomeButton); | 369 ChangeBooleanPref(0, prefs::kShowHomeButton); |
| 363 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 370 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 364 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); | 371 ASSERT_TRUE(BooleanPrefMatches(prefs::kShowHomeButton)); |
| 365 | 372 |
| 366 // Phase 6: Verify that sessions are registered and enabled. | 373 // Phase 6: Verify that sessions are registered and enabled. |
| 367 ASSERT_TRUE(GetClient(0)->IsTypeRegistered(syncable::SESSIONS)); | 374 ASSERT_TRUE(GetClient(0)->IsTypeRegistered(syncable::SESSIONS)); |
| 368 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); | 375 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); |
| 369 } | 376 } |
| OLD | NEW |