| 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 // TODO(akalin): Rename this file to migration_test.cc. | 5 // TODO(akalin): Rename this file to migration_test.cc. |
| 6 | 6 |
| 7 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 7 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/profile_sync_service_harness.h" | 9 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // complete. (Multiple migrations may be handled by each | 170 // complete. (Multiple migrations may be handled by each |
| 171 // migration cycle, but there's no guarantee of that, so we have | 171 // migration cycle, but there's no guarantee of that, so we have |
| 172 // to trigger each migration individually.) | 172 // to trigger each migration individually.) |
| 173 for (MigrationList::const_iterator it = migration_list.begin(); | 173 for (MigrationList::const_iterator it = migration_list.begin(); |
| 174 it != migration_list.end(); ++it) { | 174 it != migration_list.end(); ++it) { |
| 175 TriggerMigration(*it, trigger_method); | 175 TriggerMigration(*it, trigger_method); |
| 176 AwaitMigration(*it); | 176 AwaitMigration(*it); |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Phase 3: Wait for all clients to catch up. | 179 // Phase 3: Wait for all clients to catch up. |
| 180 AwaitQuiescence(); | 180 // |
| 181 // AwaitQuiescence() will not succeed when notifications are enabled. We |
| 182 // can safely avoid calling it because we know that, in the single client |
| 183 // case, there is no one else to wait for. |
| 184 if (!do_test_without_notifications) { |
| 185 AwaitQuiescence(); |
| 186 } |
| 181 | 187 |
| 182 // Re-enable notifications if we disabled it. | 188 // Re-enable notifications if we disabled it. |
| 183 if (do_test_without_notifications) { | 189 if (do_test_without_notifications) { |
| 184 EnableNotifications(); | 190 EnableNotifications(); |
| 185 } | 191 } |
| 186 } | 192 } |
| 187 | 193 |
| 188 private: | 194 private: |
| 189 DISALLOW_COPY_AND_ASSIGN(MigrationTest); | 195 DISALLOW_COPY_AND_ASSIGN(MigrationTest); |
| 190 }; | 196 }; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 450 |
| 445 // Phase 5: Verify that preferences can still be synchronized. | 451 // Phase 5: Verify that preferences can still be synchronized. |
| 446 VerifyPrefSync(); | 452 VerifyPrefSync(); |
| 447 | 453 |
| 448 // Phase 6: Verify that sessions are registered and enabled. | 454 // Phase 6: Verify that sessions are registered and enabled. |
| 449 ASSERT_TRUE(GetClient(0)->IsTypeRegistered(syncable::SESSIONS)); | 455 ASSERT_TRUE(GetClient(0)->IsTypeRegistered(syncable::SESSIONS)); |
| 450 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); | 456 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); |
| 451 } | 457 } |
| 452 | 458 |
| 453 } // namespace | 459 } // namespace |
| OLD | NEW |