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

Side by Side Diff: sync/protocol/proto_value_conversions_unittest.cc

Issue 11428004: Sync the bookmark's icon URL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years 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/protocol/proto_value_conversions.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Keep this file in sync with the .proto files in this directory. 5 // Keep this file in sync with the .proto files in this directory.
6 6
7 #include "sync/protocol/proto_value_conversions.h" 7 #include "sync/protocol/proto_value_conversions.h"
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 TEST_F(ProtoValueConversionsTest, AutofillProfileSpecificsToValue) { 117 TEST_F(ProtoValueConversionsTest, AutofillProfileSpecificsToValue) {
118 TestSpecificsToValue(AutofillProfileSpecificsToValue); 118 TestSpecificsToValue(AutofillProfileSpecificsToValue);
119 } 119 }
120 120
121 TEST_F(ProtoValueConversionsTest, BookmarkSpecificsToValue) { 121 TEST_F(ProtoValueConversionsTest, BookmarkSpecificsToValue) {
122 TestSpecificsToValue(BookmarkSpecificsToValue); 122 TestSpecificsToValue(BookmarkSpecificsToValue);
123 } 123 }
124 124
125 TEST_F(ProtoValueConversionsTest, BookmarkSpecificsData) { 125 TEST_F(ProtoValueConversionsTest, BookmarkSpecificsData) {
126 const base::Time creation_time(base::Time::Now()); 126 const base::Time creation_time(base::Time::Now());
127 const std::string icon_url = "http://www.google.com/favicon.ico";
127 sync_pb::BookmarkSpecifics specifics; 128 sync_pb::BookmarkSpecifics specifics;
128 specifics.set_creation_time_us(creation_time.ToInternalValue()); 129 specifics.set_creation_time_us(creation_time.ToInternalValue());
130 specifics.set_icon_url(icon_url);
129 scoped_ptr<DictionaryValue> value(BookmarkSpecificsToValue(specifics)); 131 scoped_ptr<DictionaryValue> value(BookmarkSpecificsToValue(specifics));
130 EXPECT_FALSE(value->empty()); 132 EXPECT_FALSE(value->empty());
131 std::string encoded_time; 133 std::string encoded_time;
132 EXPECT_TRUE(value->GetString("creation_time_us", &encoded_time)); 134 EXPECT_TRUE(value->GetString("creation_time_us", &encoded_time));
133 EXPECT_EQ(base::Int64ToString(creation_time.ToInternalValue()), encoded_time); 135 EXPECT_EQ(base::Int64ToString(creation_time.ToInternalValue()), encoded_time);
136 std::string encoded_icon_url;
137 EXPECT_TRUE(value->GetString("icon_url", &encoded_icon_url));
138 EXPECT_EQ(icon_url, encoded_icon_url);
134 } 139 }
135 140
136 TEST_F(ProtoValueConversionsTest, DeviceInfoSpecificsToValue) { 141 TEST_F(ProtoValueConversionsTest, DeviceInfoSpecificsToValue) {
137 TestSpecificsToValue(DeviceInfoSpecificsToValue); 142 TestSpecificsToValue(DeviceInfoSpecificsToValue);
138 } 143 }
139 144
140 TEST_F(ProtoValueConversionsTest, ExperimentsSpecificsToValue) { 145 TEST_F(ProtoValueConversionsTest, ExperimentsSpecificsToValue) {
141 TestSpecificsToValue(ExperimentsSpecificsToValue); 146 TestSpecificsToValue(ExperimentsSpecificsToValue);
142 } 147 }
143 148
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 277
273 scoped_ptr<DictionaryValue> value_without_specifics( 278 scoped_ptr<DictionaryValue> value_without_specifics(
274 ClientToServerResponseToValue(message, false /* include_specifics */)); 279 ClientToServerResponseToValue(message, false /* include_specifics */));
275 EXPECT_FALSE(value_without_specifics->empty()); 280 EXPECT_FALSE(value_without_specifics->empty());
276 EXPECT_FALSE(ValueHasSpecifics(*(value_without_specifics.get()), 281 EXPECT_FALSE(ValueHasSpecifics(*(value_without_specifics.get()),
277 "get_updates.entries")); 282 "get_updates.entries"));
278 } 283 }
279 284
280 } // namespace 285 } // namespace
281 } // namespace syncer 286 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/protocol/proto_value_conversions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698