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 |
| 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 // |
| 179 // TODO(rlarocque, 97780): Remove the if condition when the test harness |
| 180 // supports calling AwaitQuiescence() when notifications are disabled. |
| 181 if (!do_test_without_notifications) { |
| 182 AwaitQuiescence(); |
| 183 } |
175 | 184 |
176 // Re-enable notifications if we disabled it. | 185 // Re-enable notifications if we disabled it. |
177 if (do_test_without_notifications) { | 186 if (do_test_without_notifications) { |
178 EnableNotifications(); | 187 EnableNotifications(); |
179 } | 188 } |
180 } | 189 } |
181 | 190 |
182 private: | 191 private: |
183 DISALLOW_COPY_AND_ASSIGN(MigrationTest); | 192 DISALLOW_COPY_AND_ASSIGN(MigrationTest); |
184 }; | 193 }; |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 457 |
449 // Phase 5: Verify that preferences can still be synchronized. | 458 // Phase 5: Verify that preferences can still be synchronized. |
450 VerifyPrefSync(); | 459 VerifyPrefSync(); |
451 | 460 |
452 // Phase 6: Verify that sessions are registered and enabled. | 461 // Phase 6: Verify that sessions are registered and enabled. |
453 ASSERT_TRUE(GetClient(0)->IsTypeRunning(syncable::SESSIONS)); | 462 ASSERT_TRUE(GetClient(0)->IsTypeRunning(syncable::SESSIONS)); |
454 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); | 463 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); |
455 } | 464 } |
456 | 465 |
457 } // namespace | 466 } // namespace |
OLD | NEW |