| 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/live_sync/bookmarks_helper.h" | 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| 11 #include "chrome/browser/sync/test/live_sync/live_sync_test.h" | 11 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 12 #include "chrome/browser/sync/test/live_sync/preferences_helper.h" | 12 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
| 13 #include "chrome/browser/translate/translate_prefs.h" | 13 #include "chrome/browser/translate/translate_prefs.h" |
| 14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
| 16 | 16 |
| 17 using bookmarks_helper::AddURL; | 17 using bookmarks_helper::AddURL; |
| 18 using bookmarks_helper::IndexedURL; | 18 using bookmarks_helper::IndexedURL; |
| 19 using bookmarks_helper::IndexedURLTitle; | 19 using bookmarks_helper::IndexedURLTitle; |
| 20 | 20 |
| 21 using preferences_helper::BooleanPrefMatches; | 21 using preferences_helper::BooleanPrefMatches; |
| 22 using preferences_helper::ChangeBooleanPref; | 22 using preferences_helper::ChangeBooleanPref; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 MigrationList MakeList(syncable::ModelType type) { | 62 MigrationList MakeList(syncable::ModelType type) { |
| 63 return MakeList(MakeSet(type)); | 63 return MakeList(MakeSet(type)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 MigrationList MakeList(syncable::ModelType type1, | 66 MigrationList MakeList(syncable::ModelType type1, |
| 67 syncable::ModelType type2) { | 67 syncable::ModelType type2) { |
| 68 return MakeList(MakeSet(type1), MakeSet(type2)); | 68 return MakeList(MakeSet(type1), MakeSet(type2)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 class MigrationTest : public LiveSyncTest { | 71 class MigrationTest : public SyncTest { |
| 72 public: | 72 public: |
| 73 explicit MigrationTest(TestType test_type) : LiveSyncTest(test_type) {} | 73 explicit MigrationTest(TestType test_type) : SyncTest(test_type) {} |
| 74 virtual ~MigrationTest() {} | 74 virtual ~MigrationTest() {} |
| 75 | 75 |
| 76 // TODO(akalin): Add more MODIFY_(data type) trigger methods, as | 76 // TODO(akalin): Add more MODIFY_(data type) trigger methods, as |
| 77 // well as a poll-based trigger method. | 77 // well as a poll-based trigger method. |
| 78 enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; | 78 enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; |
| 79 | 79 |
| 80 syncable::ModelTypeSet GetPreferredDataTypes() { | 80 syncable::ModelTypeSet GetPreferredDataTypes() { |
| 81 syncable::ModelTypeSet preferred_data_types; | 81 syncable::ModelTypeSet preferred_data_types; |
| 82 GetClient(0)->service()->GetPreferredDataTypes(&preferred_data_types); | 82 GetClient(0)->service()->GetPreferredDataTypes(&preferred_data_types); |
| 83 // Make sure all clients have the same preferred data types. | 83 // Make sure all clients have the same preferred data types. |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 444 |
| 445 // Phase 5: Verify that preferences can still be synchronized. | 445 // Phase 5: Verify that preferences can still be synchronized. |
| 446 VerifyPrefSync(); | 446 VerifyPrefSync(); |
| 447 | 447 |
| 448 // Phase 6: Verify that sessions are registered and enabled. | 448 // Phase 6: Verify that sessions are registered and enabled. |
| 449 ASSERT_TRUE(GetClient(0)->IsTypeRegistered(syncable::SESSIONS)); | 449 ASSERT_TRUE(GetClient(0)->IsTypeRegistered(syncable::SESSIONS)); |
| 450 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); | 450 ASSERT_TRUE(GetClient(0)->IsTypePreferred(syncable::SESSIONS)); |
| 451 } | 451 } |
| 452 | 452 |
| 453 } // namespace | 453 } // namespace |
| OLD | NEW |