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

Side by Side Diff: sync/test/fake_server/bookmark_entity.cc

Issue 1232003003: [Sync] Add bookmark move tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmark-folders
Patch Set: Use a couple existing JNI methods instead. Created 5 years, 5 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
« no previous file with comments | « sync/test/fake_server/bookmark_entity.h ('k') | sync/test/fake_server/fake_server.h » ('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 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/test/fake_server/bookmark_entity.h" 5 #include "sync/test/fake_server/bookmark_entity.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 originator_cache_guid_(originator_cache_guid), 87 originator_cache_guid_(originator_cache_guid),
88 originator_client_item_id_(originator_client_item_id), 88 originator_client_item_id_(originator_client_item_id),
89 unique_position_(unique_position), 89 unique_position_(unique_position),
90 is_folder_(is_folder), 90 is_folder_(is_folder),
91 parent_id_(parent_id), 91 parent_id_(parent_id),
92 creation_time_(creation_time), 92 creation_time_(creation_time),
93 last_modified_time_(last_modified_time) { 93 last_modified_time_(last_modified_time) {
94 SetSpecifics(specifics); 94 SetSpecifics(specifics);
95 } 95 }
96 96
97 void BookmarkEntity::SetParentId(string parent_id) {
98 parent_id_ = parent_id;
99 }
100
97 string BookmarkEntity::GetParentId() const { 101 string BookmarkEntity::GetParentId() const {
98 return parent_id_; 102 return parent_id_;
99 } 103 }
100 104
101 void BookmarkEntity::SerializeAsProto(sync_pb::SyncEntity* proto) const { 105 void BookmarkEntity::SerializeAsProto(sync_pb::SyncEntity* proto) const {
102 FakeServerEntity::SerializeBaseProtoFields(proto); 106 FakeServerEntity::SerializeBaseProtoFields(proto);
103 107
104 proto->set_originator_cache_guid(originator_cache_guid_); 108 proto->set_originator_cache_guid(originator_cache_guid_);
105 proto->set_originator_client_item_id(originator_client_item_id_); 109 proto->set_originator_client_item_id(originator_client_item_id_);
106 110
107 proto->set_parent_id_string(parent_id_); 111 proto->set_parent_id_string(parent_id_);
108 proto->set_ctime(creation_time_); 112 proto->set_ctime(creation_time_);
109 proto->set_mtime(last_modified_time_); 113 proto->set_mtime(last_modified_time_);
110 114
111 sync_pb::UniquePosition* unique_position = proto->mutable_unique_position(); 115 sync_pb::UniquePosition* unique_position = proto->mutable_unique_position();
112 unique_position->CopyFrom(unique_position_); 116 unique_position->CopyFrom(unique_position_);
113 } 117 }
114 118
115 bool BookmarkEntity::IsFolder() const { 119 bool BookmarkEntity::IsFolder() const {
116 return is_folder_; 120 return is_folder_;
117 } 121 }
118 122
119 } // namespace fake_server 123 } // namespace fake_server
OLDNEW
« no previous file with comments | « sync/test/fake_server/bookmark_entity.h ('k') | sync/test/fake_server/fake_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698