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 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <map> | 10 #include <map> |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 // Takes ownership of |sync_notifier_mock_|. | 756 // Takes ownership of |sync_notifier_mock_|. |
757 sync_manager_.Init(temp_dir_.path(), | 757 sync_manager_.Init(temp_dir_.path(), |
758 WeakHandle<JsEventHandler>(), | 758 WeakHandle<JsEventHandler>(), |
759 "bogus", 0, false, | 759 "bogus", 0, false, |
760 base::MessageLoopProxy::current(), | 760 base::MessageLoopProxy::current(), |
761 scoped_ptr<HttpPostProviderFactory>( | 761 scoped_ptr<HttpPostProviderFactory>( |
762 new TestHttpPostProviderFactory()), | 762 new TestHttpPostProviderFactory()), |
763 workers, &extensions_activity_monitor_, this, | 763 workers, &extensions_activity_monitor_, this, |
764 credentials, | 764 credentials, |
765 scoped_ptr<SyncNotifier>(sync_notifier_mock_), | 765 scoped_ptr<SyncNotifier>(sync_notifier_mock_), |
766 "", | 766 "", "", // bootstrap tokens |
767 true, // enable keystore encryption | 767 true, // enable keystore encryption |
768 scoped_ptr<InternalComponentsFactory>(GetFactory()), | 768 scoped_ptr<InternalComponentsFactory>(GetFactory()), |
769 &encryptor_, | 769 &encryptor_, |
770 &handler_, | 770 &handler_, |
771 NULL); | 771 NULL); |
772 | 772 |
773 EXPECT_TRUE(js_backend_.IsInitialized()); | 773 EXPECT_TRUE(js_backend_.IsInitialized()); |
774 | 774 |
775 for (ModelSafeRoutingInfo::iterator i = routing_info.begin(); | 775 for (ModelSafeRoutingInfo::iterator i = routing_info.begin(); |
776 i != routing_info.end(); ++i) { | 776 i != routing_info.end(); ++i) { |
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 | 2766 |
2767 // Verify only the non-disabled types remain after cleanup. | 2767 // Verify only the non-disabled types remain after cleanup. |
2768 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); | 2768 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); |
2769 EXPECT_TRUE(new_enabled_types.Equals( | 2769 EXPECT_TRUE(new_enabled_types.Equals( |
2770 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); | 2770 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); |
2771 EXPECT_TRUE(disabled_types.Equals( | 2771 EXPECT_TRUE(disabled_types.Equals( |
2772 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); | 2772 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); |
2773 } | 2773 } |
2774 | 2774 |
2775 } // namespace | 2775 } // namespace |
OLD | NEW |