OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/glue/sync_backend_host_impl.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "sync/internal_api/public/http_bridge_network_resources.h" | 35 #include "sync/internal_api/public/http_bridge_network_resources.h" |
36 #include "sync/internal_api/public/network_resources.h" | 36 #include "sync/internal_api/public/network_resources.h" |
37 #include "sync/internal_api/public/sessions/commit_counters.h" | 37 #include "sync/internal_api/public/sessions/commit_counters.h" |
38 #include "sync/internal_api/public/sessions/status_counters.h" | 38 #include "sync/internal_api/public/sessions/status_counters.h" |
39 #include "sync/internal_api/public/sessions/update_counters.h" | 39 #include "sync/internal_api/public/sessions/update_counters.h" |
40 #include "sync/internal_api/public/sync_manager_factory.h" | 40 #include "sync/internal_api/public/sync_manager_factory.h" |
41 #include "sync/internal_api/public/test/fake_sync_manager.h" | 41 #include "sync/internal_api/public/test/fake_sync_manager.h" |
42 #include "sync/internal_api/public/util/experiments.h" | 42 #include "sync/internal_api/public/util/experiments.h" |
43 #include "sync/protocol/encryption.pb.h" | 43 #include "sync/protocol/encryption.pb.h" |
44 #include "sync/protocol/sync_protocol_error.h" | 44 #include "sync/protocol/sync_protocol_error.h" |
45 #include "sync/test/callback_counter.h" | |
45 #include "sync/util/test_unrecoverable_error_handler.h" | 46 #include "sync/util/test_unrecoverable_error_handler.h" |
46 #include "testing/gmock/include/gmock/gmock.h" | 47 #include "testing/gmock/include/gmock/gmock.h" |
47 #include "testing/gtest/include/gtest/gtest.h" | 48 #include "testing/gtest/include/gtest/gtest.h" |
48 #include "url/gurl.h" | 49 #include "url/gurl.h" |
49 | 50 |
50 using content::BrowserThread; | 51 using content::BrowserThread; |
51 using syncer::FakeSyncManager; | 52 using syncer::FakeSyncManager; |
52 using syncer::SyncManager; | 53 using syncer::SyncManager; |
53 using ::testing::InvokeWithoutArgs; | 54 using ::testing::InvokeWithoutArgs; |
54 using ::testing::StrictMock; | 55 using ::testing::StrictMock; |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
790 enabled_types_.RemoveAll(error_types); | 791 enabled_types_.RemoveAll(error_types); |
791 ready_types = ConfigureDataTypes( | 792 ready_types = ConfigureDataTypes( |
792 enabled_types_, Difference(syncer::ModelTypeSet::All(), enabled_types_), | 793 enabled_types_, Difference(syncer::ModelTypeSet::All(), enabled_types_), |
793 syncer::ModelTypeSet()); | 794 syncer::ModelTypeSet()); |
794 EXPECT_TRUE( | 795 EXPECT_TRUE( |
795 ready_types.Equals(syncer::Difference(enabled_types_, error_types))); | 796 ready_types.Equals(syncer::Difference(enabled_types_, error_types))); |
796 EXPECT_FALSE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( | 797 EXPECT_FALSE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( |
797 error_types).Empty()); | 798 error_types).Empty()); |
798 } | 799 } |
799 | 800 |
801 // Test that a call to ClearServerData is forwarded to the underlying | |
802 // SyncManager. | |
803 TEST_F(SyncBackendHostTest, ClearServerDataCallsAreForwarded) { | |
804 InitializeBackend(true); | |
805 syncer::CallbackCounter callback_counter; | |
806 syncer::SyncManager::ClearServerDataCallback callback; | |
pavely
2015/07/29 22:57:23
Callback is not used. Remove.
maniscalco
2015/07/29 23:01:09
Good catch! Done.
| |
807 backend_->ClearServerData(base::Bind(&syncer::CallbackCounter::Callback, | |
808 base::Unretained(&callback_counter))); | |
809 fake_manager_->WaitForSyncThread(); | |
810 EXPECT_EQ(1, callback_counter.times_called()); | |
811 } | |
812 | |
800 } // namespace | 813 } // namespace |
801 | 814 |
802 } // namespace browser_sync | 815 } // namespace browser_sync |
OLD | NEW |