| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 811 |
| 812 service->EnableEncryptEverything(); | 812 service->EnableEncryptEverything(); |
| 813 | 813 |
| 814 // In order to kick off the encryption we have to reconfigure. Just grab the | 814 // In order to kick off the encryption we have to reconfigure. Just grab the |
| 815 // currently synced types and use them. | 815 // currently synced types and use them. |
| 816 const syncer::ModelTypeSet synced_datatypes = | 816 const syncer::ModelTypeSet synced_datatypes = |
| 817 service->GetPreferredDataTypes(); | 817 service->GetPreferredDataTypes(); |
| 818 bool sync_everything = synced_datatypes.Equals(syncer::ModelTypeSet::All()); | 818 bool sync_everything = synced_datatypes.Equals(syncer::ModelTypeSet::All()); |
| 819 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); | 819 service->OnUserChoseDatatypes(sync_everything, synced_datatypes); |
| 820 | 820 |
| 821 // Wait some time to let the enryption finish. | 821 return AwaitEncryptionComplete(index); |
| 822 EncryptionChecker checker(service); | |
| 823 checker.Wait(); | |
| 824 | |
| 825 return !checker.TimedOut(); | |
| 826 } | 822 } |
| 827 | 823 |
| 828 bool SyncTest::IsEncryptionComplete(int index) { | 824 bool SyncTest::IsEncryptionComplete(int index) { |
| 829 return ::IsEncryptionComplete(GetClient(index)->service()); | 825 return ::IsEncryptionComplete(GetClient(index)->service()); |
| 830 } | 826 } |
| 831 | 827 |
| 828 bool SyncTest::AwaitEncryptionComplete(int index) { |
| 829 ProfileSyncService* service = GetClient(index)->service(); |
| 830 EncryptionChecker checker(service); |
| 831 checker.Wait(); |
| 832 return !checker.TimedOut(); |
| 833 } |
| 834 |
| 832 bool SyncTest::AwaitQuiescence() { | 835 bool SyncTest::AwaitQuiescence() { |
| 833 return ProfileSyncServiceHarness::AwaitQuiescence(clients()); | 836 return ProfileSyncServiceHarness::AwaitQuiescence(clients()); |
| 834 } | 837 } |
| 835 | 838 |
| 836 bool SyncTest::ServerSupportsNotificationControl() const { | 839 bool SyncTest::ServerSupportsNotificationControl() const { |
| 837 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_); | 840 EXPECT_NE(SERVER_TYPE_UNDECIDED, server_type_); |
| 838 | 841 |
| 839 // Supported only if we're using the python testserver. | 842 // Supported only if we're using the python testserver. |
| 840 return server_type_ == LOCAL_PYTHON_SERVER; | 843 return server_type_ == LOCAL_PYTHON_SERVER; |
| 841 } | 844 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 BrowserThread::PostTask( | 1042 BrowserThread::PostTask( |
| 1040 BrowserThread::IO, FROM_HERE, | 1043 BrowserThread::IO, FROM_HERE, |
| 1041 base::Bind(&SetProxyConfigCallback, &done, | 1044 base::Bind(&SetProxyConfigCallback, &done, |
| 1042 make_scoped_refptr(context_getter), proxy_config)); | 1045 make_scoped_refptr(context_getter), proxy_config)); |
| 1043 done.Wait(); | 1046 done.Wait(); |
| 1044 } | 1047 } |
| 1045 | 1048 |
| 1046 fake_server::FakeServer* SyncTest::GetFakeServer() const { | 1049 fake_server::FakeServer* SyncTest::GetFakeServer() const { |
| 1047 return fake_server_.get(); | 1050 return fake_server_.get(); |
| 1048 } | 1051 } |
| OLD | NEW |