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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 828 |
829 service->EnableEncryptEverything(); | 829 service->EnableEncryptEverything(); |
830 | 830 |
831 // In order to kick off the encryption we have to reconfigure. Just grab the | 831 // In order to kick off the encryption we have to reconfigure. Just grab the |
832 // currently synced types and use them. | 832 // currently synced types and use them. |
833 const syncer::ModelTypeSet synced_datatypes = | 833 const syncer::ModelTypeSet synced_datatypes = |
834 service->GetPreferredDataTypes(); | 834 service->GetPreferredDataTypes(); |
835 bool sync_everything = synced_datatypes.Equals(syncer::ModelTypeSet::All()); | 835 bool sync_everything = synced_datatypes.Equals(syncer::ModelTypeSet::All()); |
836 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); | 836 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); |
837 | 837 |
838 // Wait some time to let the enryption finish. | 838 return AwaitEncryptionComplete(index); |
839 EncryptionChecker checker(service); | |
840 checker.Wait(); | |
841 | |
842 return !checker.TimedOut(); | |
843 } | 839 } |
844 | 840 |
845 bool SyncTest::IsEncryptionComplete(int index) { | 841 bool SyncTest::IsEncryptionComplete(int index) { |
846 return ::IsEncryptionComplete(GetClient(index)->service()); | 842 return ::IsEncryptionComplete(GetClient(index)->service()); |
847 } | 843 } |
848 | 844 |
| 845 bool SyncTest::AwaitEncryptionComplete(int index) { |
| 846 ProfileSyncService* service = GetClient(index)->service(); |
| 847 EncryptionChecker checker(service); |
| 848 checker.Wait(); |
| 849 return !checker.TimedOut(); |
| 850 } |
| 851 |
849 bool SyncTest::AwaitQuiescence() { | 852 bool SyncTest::AwaitQuiescence() { |
850 return ProfileSyncServiceHarness::AwaitQuiescence(clients()); | 853 return ProfileSyncServiceHarness::AwaitQuiescence(clients()); |
851 } | 854 } |
852 | 855 |
853 bool SyncTest::ServerSupportsNotificationControl() const { | 856 bool SyncTest::ServerSupportsNotificationControl() const { |
854 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_); | 857 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_); |
855 | 858 |
856 // Supported only if we're using the python testserver. | 859 // Supported only if we're using the python testserver. |
857 return server_type_ == LOCAL_PYTHON_SERVER; | 860 return server_type_ == LOCAL_PYTHON_SERVER; |
858 } | 861 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 BrowserThread::PostTask( | 1051 BrowserThread::PostTask( |
1049 BrowserThread::IO, FROM_HERE, | 1052 BrowserThread::IO, FROM_HERE, |
1050 base::Bind(&SetProxyConfigCallback, &done, | 1053 base::Bind(&SetProxyConfigCallback, &done, |
1051 make_scoped_refptr(context_getter), proxy_config)); | 1054 make_scoped_refptr(context_getter), proxy_config)); |
1052 done.Wait(); | 1055 done.Wait(); |
1053 } | 1056 } |
1054 | 1057 |
1055 fake_server::FakeServer* SyncTest::GetFakeServer() const { | 1058 fake_server::FakeServer* SyncTest::GetFakeServer() const { |
1056 return fake_server_.get(); | 1059 return fake_server_.get(); |
1057 } | 1060 } |
OLD | NEW |