OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 bool SyncTest::EnableEncryption(int index) { | 962 bool SyncTest::EnableEncryption(int index) { |
963 ProfileSyncService* service = GetClient(index)->service(); | 963 ProfileSyncService* service = GetClient(index)->service(); |
964 | 964 |
965 if (::IsEncryptionComplete(service)) | 965 if (::IsEncryptionComplete(service)) |
966 return true; | 966 return true; |
967 | 967 |
968 service->EnableEncryptEverything(); | 968 service->EnableEncryptEverything(); |
969 | 969 |
970 // In order to kick off the encryption we have to reconfigure. Just grab the | 970 // In order to kick off the encryption we have to reconfigure. Just grab the |
971 // currently synced types and use them. | 971 // currently synced types and use them. |
972 syncer::ModelTypeSet synced_datatypes = service->GetPreferredDataTypes(); | 972 const syncer::ModelTypeSet synced_datatypes = |
| 973 service->GetPreferredDataTypes(); |
973 bool sync_everything = synced_datatypes.Equals(syncer::ModelTypeSet::All()); | 974 bool sync_everything = synced_datatypes.Equals(syncer::ModelTypeSet::All()); |
974 synced_datatypes.RetainAll(syncer::UserSelectableTypes()); | |
975 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); | 975 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); |
976 | 976 |
977 return AwaitEncryptionComplete(index); | 977 return AwaitEncryptionComplete(index); |
978 } | 978 } |
979 | 979 |
980 bool SyncTest::IsEncryptionComplete(int index) { | 980 bool SyncTest::IsEncryptionComplete(int index) { |
981 return ::IsEncryptionComplete(GetClient(index)->service()); | 981 return ::IsEncryptionComplete(GetClient(index)->service()); |
982 } | 982 } |
983 | 983 |
984 bool SyncTest::AwaitEncryptionComplete(int index) { | 984 bool SyncTest::AwaitEncryptionComplete(int index) { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 content::NotificationService::current()->Notify( | 1111 content::NotificationService::current()->Notify( |
1112 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, | 1112 chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, |
1113 content::Source<Profile>(GetProfile(index)), | 1113 content::Source<Profile>(GetProfile(index)), |
1114 content::Details<const syncer::ModelTypeSet>(&model_types)); | 1114 content::Details<const syncer::ModelTypeSet>(&model_types)); |
1115 } | 1115 } |
1116 | 1116 |
1117 void SyncTest::SetPreexistingPreferencesFileContents( | 1117 void SyncTest::SetPreexistingPreferencesFileContents( |
1118 const std::string& contents) { | 1118 const std::string& contents) { |
1119 preexisting_preferences_file_contents_ = contents; | 1119 preexisting_preferences_file_contents_ = contents; |
1120 } | 1120 } |
OLD | NEW |