Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Side by Side Diff: sync/internal_api/sync_encryption_handler_impl_unittest.cc

Issue 11817010: sync: Initialize entries with a valid model type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix broken DCHECKs Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/public/write_node.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « sync/internal_api/public/write_node.h ('k') | sync/internal_api/sync_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698