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 // TODO(akalin): Rename this file to migration_test.cc. | 5 // TODO(akalin): Rename this file to migration_test.cc. |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 8 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 // complete. (Multiple migrations may be handled by each | 164 // complete. (Multiple migrations may be handled by each |
| 165 // migration cycle, but there's no guarantee of that, so we have | 165 // migration cycle, but there's no guarantee of that, so we have |
| 166 // to trigger each migration individually.) | 166 // to trigger each migration individually.) |
| 167 for (MigrationList::const_iterator it = migration_list.begin(); | 167 for (MigrationList::const_iterator it = migration_list.begin(); |
| 168 it != migration_list.end(); ++it) { | 168 it != migration_list.end(); ++it) { |
| 169 TriggerMigration(*it, trigger_method); | 169 TriggerMigration(*it, trigger_method); |
| 170 AwaitMigration(*it); | 170 AwaitMigration(*it); |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Phase 3: Wait for all clients to catch up. | 173 // Phase 3: Wait for all clients to catch up. |
| 174 ASSERT_TRUE(AwaitQuiescence()); | 174 // |
| 175 // AwaitQuiescence() will not succeed when notifications are disabled. We | |
|
akalin
2012/01/20 22:41:51
Why is this true? It seems to me that a single cl
rlarocque
2012/01/20 23:04:56
Not according to the definition in the integration
akalin
2012/01/20 23:07:24
Add TODO to change this back and refer to bug.
| |
| 176 // can safely avoid calling it because we know that, in the single client | |
| 177 // case, there is no one else to wait for. | |
| 178 if (!do_test_without_notifications) { | |
| 179 AwaitQuiescence(); | |
| 180 } | |
| 175 | 181 |
| 176 // Re-enable notifications if we disabled it. | 182 // Re-enable notifications if we disabled it. |
| 177 if (do_test_without_notifications) { | 183 if (do_test_without_notifications) { |
| 178 EnableNotifications(); | 184 EnableNotifications(); |
| 179 } | 185 } |
| 180 } | 186 } |
| 181 | 187 |
| 182 private: | 188 private: |
| 183 DISALLOW_COPY_AND_ASSIGN(MigrationTest); | 189 DISALLOW_COPY_AND_ASSIGN(MigrationTest); |
| 184 }; | 190 }; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 | 454 |
| 449 // Phase 5: Verify that preferences can still be synchronized. | 455 // Phase 5: Verify that preferences can still be synchronized. |
| 450 VerifyPrefSync(); | 456 VerifyPrefSync(); |
| 451 | 457 |
| 452 // Phase 6: Verify that sessions are registered and enabled. | 458 // Phase 6: Verify that sessions are registered and enabled. |
| 453 ASSERT_TRUE(GetClient(0)->IsTypeRunning(syncable::SESSIONS)); | 459 ASSERT_TRUE(GetClient(0)->IsTypeRunning(syncable::SESSIONS)); |
| 454 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); | 460 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); |
| 455 } | 461 } |
| 456 | 462 |
| 457 } // namespace | 463 } // namespace |
| OLD | NEW |