| 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/internal_api/sync_encryption_handler_impl.h" | 5 #include "sync/internal_api/sync_encryption_handler_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 void CreateRootForType(ModelType model_type) { | 98 void CreateRootForType(ModelType model_type) { |
| 99 syncer::syncable::Directory* directory = user_share()->directory.get(); | 99 syncer::syncable::Directory* directory = user_share()->directory.get(); |
| 100 | 100 |
| 101 std::string tag_name = ModelTypeToRootTag(model_type); | 101 std::string tag_name = ModelTypeToRootTag(model_type); |
| 102 | 102 |
| 103 syncable::WriteTransaction wtrans(FROM_HERE, syncable::UNITTEST, directory); | 103 syncable::WriteTransaction wtrans(FROM_HERE, syncable::UNITTEST, directory); |
| 104 syncable::MutableEntry node(&wtrans, | 104 syncable::MutableEntry node(&wtrans, |
| 105 syncable::CREATE, | 105 syncable::CREATE, |
| 106 model_type, |
| 106 wtrans.root_id(), | 107 wtrans.root_id(), |
| 107 tag_name); | 108 tag_name); |
| 108 node.Put(syncable::UNIQUE_SERVER_TAG, tag_name); | 109 node.Put(syncable::UNIQUE_SERVER_TAG, tag_name); |
| 109 node.Put(syncable::IS_DIR, true); | 110 node.Put(syncable::IS_DIR, true); |
| 110 node.Put(syncable::SERVER_IS_DIR, false); | 111 node.Put(syncable::SERVER_IS_DIR, false); |
| 111 node.Put(syncable::IS_UNSYNCED, false); | 112 node.Put(syncable::IS_UNSYNCED, false); |
| 112 node.Put(syncable::IS_UNAPPLIED_UPDATE, false); | 113 node.Put(syncable::IS_UNAPPLIED_UPDATE, false); |
| 113 node.Put(syncable::SERVER_VERSION, 20); | 114 node.Put(syncable::SERVER_VERSION, 20); |
| 114 node.Put(syncable::BASE_VERSION, 20); | 115 node.Put(syncable::BASE_VERSION, 20); |
| 115 node.Put(syncable::IS_DEL, false); | 116 node.Put(syncable::IS_DEL, false); |
| (...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 encryption_handler()->SetKeystoreKeys(keys, | 2242 encryption_handler()->SetKeystoreKeys(keys, |
| 2242 trans.GetWrappedTrans()); | 2243 trans.GetWrappedTrans()); |
| 2243 } | 2244 } |
| 2244 PumpLoop(); | 2245 PumpLoop(); |
| 2245 Mock::VerifyAndClearExpectations(observer()); | 2246 Mock::VerifyAndClearExpectations(observer()); |
| 2246 | 2247 |
| 2247 VerifyMigratedNigoriWithTimestamp(1, CUSTOM_PASSPHRASE, kCustomPass); | 2248 VerifyMigratedNigoriWithTimestamp(1, CUSTOM_PASSPHRASE, kCustomPass); |
| 2248 } | 2249 } |
| 2249 | 2250 |
| 2250 } // namespace syncer | 2251 } // namespace syncer |
| OLD | NEW |