| 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 "components/sync/engine_impl/apply_control_data_updates.h" | 5 #include "components/sync/engine_impl/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 <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/format_macros.h" | 13 #include "base/format_macros.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" |
| 16 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 18 #include "components/sync/base/cryptographer.h" | 19 #include "components/sync/base/cryptographer.h" |
| 19 #include "components/sync/engine_impl/syncer.h" | 20 #include "components/sync/engine_impl/syncer.h" |
| 20 #include "components/sync/engine_impl/syncer_util.h" | 21 #include "components/sync/engine_impl/syncer_util.h" |
| 21 #include "components/sync/engine_impl/test_entry_factory.h" | 22 #include "components/sync/engine_impl/test_entry_factory.h" |
| 22 #include "components/sync/protocol/nigori_specifics.pb.h" | 23 #include "components/sync/protocol/nigori_specifics.pb.h" |
| 23 #include "components/sync/syncable/directory.h" | 24 #include "components/sync/syncable/directory.h" |
| 24 #include "components/sync/syncable/mutable_entry.h" | 25 #include "components/sync/syncable/mutable_entry.h" |
| 25 #include "components/sync/syncable/nigori_util.h" | 26 #include "components/sync/syncable/nigori_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 using syncable::Id; | 40 using syncable::Id; |
| 40 | 41 |
| 41 class ApplyControlDataUpdatesTest : public ::testing::Test { | 42 class ApplyControlDataUpdatesTest : public ::testing::Test { |
| 42 public: | 43 public: |
| 43 protected: | 44 protected: |
| 44 ApplyControlDataUpdatesTest() {} | 45 ApplyControlDataUpdatesTest() {} |
| 45 ~ApplyControlDataUpdatesTest() override {} | 46 ~ApplyControlDataUpdatesTest() override {} |
| 46 | 47 |
| 47 void SetUp() override { | 48 void SetUp() override { |
| 48 dir_maker_.SetUp(); | 49 dir_maker_.SetUp(); |
| 49 entry_factory_.reset(new TestEntryFactory(directory())); | 50 entry_factory_ = base::MakeUnique<TestEntryFactory>(directory()); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void TearDown() override { dir_maker_.TearDown(); } | 53 void TearDown() override { dir_maker_.TearDown(); } |
| 53 | 54 |
| 54 syncable::Directory* directory() { return dir_maker_.directory(); } | 55 syncable::Directory* directory() { return dir_maker_.directory(); } |
| 55 | 56 |
| 56 TestIdFactory id_factory_; | 57 TestIdFactory id_factory_; |
| 57 std::unique_ptr<TestEntryFactory> entry_factory_; | 58 std::unique_ptr<TestEntryFactory> entry_factory_; |
| 58 | 59 |
| 59 private: | 60 private: |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 ApplyControlDataUpdates(directory()); | 970 ApplyControlDataUpdates(directory()); |
| 970 | 971 |
| 971 // After applying the updates NIGORI should be marked as having its | 972 // After applying the updates NIGORI should be marked as having its |
| 972 // initial sync completed. | 973 // initial sync completed. |
| 973 EXPECT_TRUE(directory()->InitialSyncEndedForType(NIGORI)); | 974 EXPECT_TRUE(directory()->InitialSyncEndedForType(NIGORI)); |
| 974 // Verify that there is no side effect on another control type. | 975 // Verify that there is no side effect on another control type. |
| 975 EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS)); | 976 EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS)); |
| 976 } | 977 } |
| 977 | 978 |
| 978 } // namespace syncer | 979 } // namespace syncer |
| OLD | NEW |