OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/sync/device_info/device_info_sync_bridge.h" | 5 #include "components/sync/device_info/device_info_sync_bridge.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 EXPECT_EQ(2, change_count()); | 610 EXPECT_EQ(2, change_count()); |
611 | 611 |
612 // The remote should beat the local in conflict. | 612 // The remote should beat the local in conflict. |
613 EXPECT_EQ(4u, bridge()->GetAllDeviceInfo().size()); | 613 EXPECT_EQ(4u, bridge()->GetAllDeviceInfo().size()); |
614 VerifyEqual(unique_local, | 614 VerifyEqual(unique_local, |
615 *bridge()->GetDeviceInfo(unique_local.cache_guid()).get()); | 615 *bridge()->GetDeviceInfo(unique_local.cache_guid()).get()); |
616 VerifyEqual(unique_remote, | 616 VerifyEqual(unique_remote, |
617 *bridge()->GetDeviceInfo(unique_remote.cache_guid()).get()); | 617 *bridge()->GetDeviceInfo(unique_remote.cache_guid()).get()); |
618 VerifyEqual(conflict_remote, *bridge()->GetDeviceInfo(conflict_guid).get()); | 618 VerifyEqual(conflict_remote, *bridge()->GetDeviceInfo(conflict_guid).get()); |
619 | 619 |
620 // bridge should have told the processor about the existance of unique_local. | 620 // bridge should have told the processor about the existence of unique_local. |
621 EXPECT_TRUE(processor().delete_set().empty()); | 621 EXPECT_TRUE(processor().delete_set().empty()); |
622 EXPECT_EQ(3u, processor().put_multimap().size()); | 622 EXPECT_EQ(3u, processor().put_multimap().size()); |
623 EXPECT_EQ(1u, processor().put_multimap().count(unique_local.cache_guid())); | 623 EXPECT_EQ(1u, processor().put_multimap().count(unique_local.cache_guid())); |
624 const auto& it = processor().put_multimap().find(unique_local.cache_guid()); | 624 const auto& it = processor().put_multimap().find(unique_local.cache_guid()); |
625 ASSERT_NE(processor().put_multimap().end(), it); | 625 ASSERT_NE(processor().put_multimap().end(), it); |
626 VerifyEqual(unique_local, it->second->specifics.device_info()); | 626 VerifyEqual(unique_local, it->second->specifics.device_info()); |
627 | 627 |
628 RestartBridge(); | 628 RestartBridge(); |
629 EXPECT_EQ(state.encryption_key_name(), | 629 EXPECT_EQ(state.encryption_key_name(), |
630 processor().metadata()->GetModelTypeState().encryption_key_name()); | 630 processor().metadata()->GetModelTypeState().encryption_key_name()); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 763 |
764 // Reloading from storage shouldn't contain remote data. | 764 // Reloading from storage shouldn't contain remote data. |
765 RestartBridge(); | 765 RestartBridge(); |
766 EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size()); | 766 EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size()); |
767 EXPECT_EQ(4, change_count()); | 767 EXPECT_EQ(4, change_count()); |
768 } | 768 } |
769 | 769 |
770 } // namespace | 770 } // namespace |
771 | 771 |
772 } // namespace syncer | 772 } // namespace syncer |
OLD | NEW |