OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "sync/engine/apply_control_data_updates.h" | 5 #include "sync/engine/apply_control_data_updates.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/format_macros.h" | 13 #include "base/format_macros.h" |
13 #include "base/location.h" | 14 #include "base/location.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "sync/engine/syncer.h" | 18 #include "sync/engine/syncer.h" |
19 #include "sync/engine/syncer_util.h" | 19 #include "sync/engine/syncer_util.h" |
20 #include "sync/internal_api/public/test/test_entry_factory.h" | 20 #include "sync/internal_api/public/test/test_entry_factory.h" |
21 #include "sync/protocol/nigori_specifics.pb.h" | 21 #include "sync/protocol/nigori_specifics.pb.h" |
22 #include "sync/syncable/directory.h" | 22 #include "sync/syncable/directory.h" |
23 #include "sync/syncable/mutable_entry.h" | 23 #include "sync/syncable/mutable_entry.h" |
24 #include "sync/syncable/nigori_util.h" | 24 #include "sync/syncable/nigori_util.h" |
25 #include "sync/syncable/syncable_read_transaction.h" | 25 #include "sync/syncable/syncable_read_transaction.h" |
(...skipping 23 matching lines...) Expand all Loading... |
49 entry_factory_.reset(new TestEntryFactory(directory())); | 49 entry_factory_.reset(new TestEntryFactory(directory())); |
50 } | 50 } |
51 | 51 |
52 void TearDown() override { dir_maker_.TearDown(); } | 52 void TearDown() override { dir_maker_.TearDown(); } |
53 | 53 |
54 syncable::Directory* directory() { | 54 syncable::Directory* directory() { |
55 return dir_maker_.directory(); | 55 return dir_maker_.directory(); |
56 } | 56 } |
57 | 57 |
58 TestIdFactory id_factory_; | 58 TestIdFactory id_factory_; |
59 scoped_ptr<TestEntryFactory> entry_factory_; | 59 std::unique_ptr<TestEntryFactory> entry_factory_; |
| 60 |
60 private: | 61 private: |
61 base::MessageLoop loop_; // Needed for directory init. | 62 base::MessageLoop loop_; // Needed for directory init. |
62 TestDirectorySetterUpper dir_maker_; | 63 TestDirectorySetterUpper dir_maker_; |
63 | 64 |
64 DISALLOW_COPY_AND_ASSIGN(ApplyControlDataUpdatesTest); | 65 DISALLOW_COPY_AND_ASSIGN(ApplyControlDataUpdatesTest); |
65 }; | 66 }; |
66 | 67 |
67 // Verify that applying a nigori node sets initial sync ended properly, | 68 // Verify that applying a nigori node sets initial sync ended properly, |
68 // updates the set of encrypted types, and updates the cryptographer. | 69 // updates the set of encrypted types, and updates the cryptographer. |
69 TEST_F(ApplyControlDataUpdatesTest, NigoriUpdate) { | 70 TEST_F(ApplyControlDataUpdatesTest, NigoriUpdate) { |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 ApplyControlDataUpdates(directory()); | 965 ApplyControlDataUpdates(directory()); |
965 | 966 |
966 // After applying the updates NIGORI should be marked as having its | 967 // After applying the updates NIGORI should be marked as having its |
967 // initial sync completed. | 968 // initial sync completed. |
968 EXPECT_TRUE(directory()->InitialSyncEndedForType(NIGORI)); | 969 EXPECT_TRUE(directory()->InitialSyncEndedForType(NIGORI)); |
969 // Verify that there is no side effect on another control type. | 970 // Verify that there is no side effect on another control type. |
970 EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS)); | 971 EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS)); |
971 } | 972 } |
972 | 973 |
973 } // namespace syncer | 974 } // namespace syncer |
OLD | NEW |