OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/internal_api/sync_backup_manager.h" | 5 #include "sync/internal_api/sync_backup_manager.h" |
6 | 6 |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "sync/internal_api/public/read_node.h" | 8 #include "sync/internal_api/public/read_node.h" |
9 #include "sync/internal_api/public/read_transaction.h" | 9 #include "sync/internal_api/public/read_transaction.h" |
10 #include "sync/internal_api/public/test/test_internal_components_factory.h" | 10 #include "sync/internal_api/public/test/test_internal_components_factory.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 ModelTypeSet(), ModelTypeSet(), ModelTypeSet(), | 45 ModelTypeSet(), ModelTypeSet(), ModelTypeSet(), |
46 ModelSafeRoutingInfo(), | 46 ModelSafeRoutingInfo(), |
47 base::Bind(&OnConfigDone, true), | 47 base::Bind(&OnConfigDone, true), |
48 base::Bind(&OnConfigDone, false)); | 48 base::Bind(&OnConfigDone, false)); |
49 } | 49 } |
50 | 50 |
51 void CreateEntry(UserShare* user_share, ModelType type, | 51 void CreateEntry(UserShare* user_share, ModelType type, |
52 const std::string& client_tag) { | 52 const std::string& client_tag) { |
53 WriteTransaction trans(FROM_HERE, user_share); | 53 WriteTransaction trans(FROM_HERE, user_share); |
54 ReadNode type_root(&trans); | 54 ReadNode type_root(&trans); |
55 EXPECT_EQ(BaseNode::INIT_OK, | 55 EXPECT_EQ(BaseNode::INIT_OK, type_root.InitTypeRoot(type)); |
56 type_root.InitByTagLookup(ModelTypeToRootTag(type))); | |
57 | 56 |
58 WriteNode node(&trans); | 57 WriteNode node(&trans); |
59 EXPECT_EQ(WriteNode::INIT_SUCCESS, | 58 EXPECT_EQ(WriteNode::INIT_SUCCESS, |
60 node.InitUniqueByCreation(type, type_root, client_tag)); | 59 node.InitUniqueByCreation(type, type_root, client_tag)); |
61 } | 60 } |
62 | 61 |
63 base::ScopedTempDir temp_dir_; | 62 base::ScopedTempDir temp_dir_; |
64 base::MessageLoop loop_; // Needed for WeakHandle | 63 base::MessageLoop loop_; // Needed for WeakHandle |
65 }; | 64 }; |
66 | 65 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 pref.InitByClientTagLookup(PREFERENCES, "test")); | 102 pref.InitByClientTagLookup(PREFERENCES, "test")); |
104 EXPECT_TRUE(pref.GetEntry()->GetId().ServerKnows()); | 103 EXPECT_TRUE(pref.GetEntry()->GetId().ServerKnows()); |
105 EXPECT_FALSE(pref.GetEntry()->GetIsUnsynced()); | 104 EXPECT_FALSE(pref.GetEntry()->GetIsUnsynced()); |
106 } | 105 } |
107 } | 106 } |
108 | 107 |
109 } // anonymous namespace | 108 } // anonymous namespace |
110 | 109 |
111 } // namespace syncer | 110 } // namespace syncer |
112 | 111 |
OLD | NEW |