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 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 | 2558 |
2559 // Test that the configuration params are properly created and sent to | 2559 // Test that the configuration params are properly created and sent to |
2560 // ScheduleConfigure. No callback should be invoked. Any disabled datatypes | 2560 // ScheduleConfigure. No callback should be invoked. Any disabled datatypes |
2561 // should be purged. | 2561 // should be purged. |
2562 // Fails on Windows: crbug.com/139726 | 2562 // Fails on Windows: crbug.com/139726 |
2563 #if defined(OS_WIN) | 2563 #if defined(OS_WIN) |
2564 #define MAYBE_BasicConfiguration DISABLED_BasicConfiguration | 2564 #define MAYBE_BasicConfiguration DISABLED_BasicConfiguration |
2565 #else | 2565 #else |
2566 #define MAYBE_BasicConfiguration BasicConfiguration | 2566 #define MAYBE_BasicConfiguration BasicConfiguration |
2567 #endif | 2567 #endif |
2568 TEST_F(SyncManagerTestWithMockScheduler, BasicConfiguration) { | 2568 TEST_F(SyncManagerTestWithMockScheduler, MAYBE_BasicConfiguration) { |
2569 ConfigureReason reason = CONFIGURE_REASON_RECONFIGURATION; | 2569 ConfigureReason reason = CONFIGURE_REASON_RECONFIGURATION; |
2570 ModelTypeSet types_to_download(BOOKMARKS, PREFERENCES); | 2570 ModelTypeSet types_to_download(BOOKMARKS, PREFERENCES); |
2571 ModelSafeRoutingInfo new_routing_info; | 2571 ModelSafeRoutingInfo new_routing_info; |
2572 GetModelSafeRoutingInfo(&new_routing_info); | 2572 GetModelSafeRoutingInfo(&new_routing_info); |
2573 ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info); | 2573 ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info); |
2574 ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types); | 2574 ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types); |
2575 | 2575 |
2576 ConfigurationParams params; | 2576 ConfigurationParams params; |
2577 EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE)); | 2577 EXPECT_CALL(*scheduler(), Start(SyncScheduler::CONFIGURATION_MODE)); |
2578 EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)). | 2578 EXPECT_CALL(*scheduler(), ScheduleConfiguration(_)). |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 | 2739 |
2740 // Test CleanipDisabledTypes properly purges all disabled types as specified | 2740 // Test CleanipDisabledTypes properly purges all disabled types as specified |
2741 // by the previous and current enabled params. Enabled partial types should not | 2741 // by the previous and current enabled params. Enabled partial types should not |
2742 // be purged. | 2742 // be purged. |
2743 // Fails on Windows: crbug.com/139726 | 2743 // Fails on Windows: crbug.com/139726 |
2744 #if defined(OS_WIN) | 2744 #if defined(OS_WIN) |
2745 #define MAYBE_PurgeDisabledTypes DISABLED_PurgeDisabledTypes | 2745 #define MAYBE_PurgeDisabledTypes DISABLED_PurgeDisabledTypes |
2746 #else | 2746 #else |
2747 #define MAYBE_PurgeDisabledTypes PurgeDisabledTypes | 2747 #define MAYBE_PurgeDisabledTypes PurgeDisabledTypes |
2748 #endif | 2748 #endif |
2749 TEST_F(SyncManagerTest, PurgeDisabledTypes) { | 2749 TEST_F(SyncManagerTest, MAYBE_PurgeDisabledTypes) { |
2750 ModelSafeRoutingInfo routing_info; | 2750 ModelSafeRoutingInfo routing_info; |
2751 GetModelSafeRoutingInfo(&routing_info); | 2751 GetModelSafeRoutingInfo(&routing_info); |
2752 ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info); | 2752 ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info); |
2753 ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types); | 2753 ModelTypeSet disabled_types = Difference(ModelTypeSet::All(), enabled_types); |
2754 ModelTypeSet partial_enabled_types(PASSWORDS); | 2754 ModelTypeSet partial_enabled_types(PASSWORDS); |
2755 | 2755 |
2756 // Set data for all non-partial types. | 2756 // Set data for all non-partial types. |
2757 for (ModelTypeSet::Iterator iter = ModelTypeSet::All().First(); iter.Good(); | 2757 for (ModelTypeSet::Iterator iter = ModelTypeSet::All().First(); iter.Good(); |
2758 iter.Inc()) { | 2758 iter.Inc()) { |
2759 SetProgressMarkerForType(iter.Get(), true); | 2759 SetProgressMarkerForType(iter.Get(), true); |
(...skipping 17 matching lines...) Expand all Loading... |
2777 | 2777 |
2778 // Verify only the non-disabled types remain after cleanup. | 2778 // Verify only the non-disabled types remain after cleanup. |
2779 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); | 2779 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); |
2780 EXPECT_TRUE(new_enabled_types.Equals( | 2780 EXPECT_TRUE(new_enabled_types.Equals( |
2781 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); | 2781 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); |
2782 EXPECT_TRUE(disabled_types.Equals( | 2782 EXPECT_TRUE(disabled_types.Equals( |
2783 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); | 2783 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); |
2784 } | 2784 } |
2785 | 2785 |
2786 } // namespace | 2786 } // namespace |
OLD | NEW |