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

Unified Diff: sync/protocol/proto_value_conversions_unittest.cc

Issue 11090083: Makes sync code persist the date the node was added. I'm hoping this covers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/protocol/proto_value_conversions.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/protocol/proto_value_conversions_unittest.cc
diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc
index fd364501d144a89b61ccbc11c0f60c179dd71cbf..5542e67606bf82f87f5890f48d97e57804092e70 100644
--- a/sync/protocol/proto_value_conversions_unittest.cc
+++ b/sync/protocol/proto_value_conversions_unittest.cc
@@ -7,6 +7,8 @@
#include "sync/protocol/proto_value_conversions.h"
#include "base/memory/scoped_ptr.h"
+#include "base/string_number_conversions.h"
+#include "base/time.h"
#include "base/values.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/protocol/app_notification_specifics.pb.h"
@@ -120,6 +122,17 @@ TEST_F(ProtoValueConversionsTest, BookmarkSpecificsToValue) {
TestSpecificsToValue(BookmarkSpecificsToValue);
}
+TEST_F(ProtoValueConversionsTest, BookmarkSpecificsData) {
+ const base::Time creation_time(base::Time::Now());
+ sync_pb::BookmarkSpecifics specifics;
+ specifics.set_creation_time_us(creation_time.ToInternalValue());
+ scoped_ptr<DictionaryValue> value(BookmarkSpecificsToValue(specifics));
+ EXPECT_FALSE(value->empty());
+ std::string encoded_time;
+ EXPECT_TRUE(value->GetString("creation_time_us", &encoded_time));
+ EXPECT_EQ(base::Int64ToString(creation_time.ToInternalValue()), encoded_time);
+}
+
TEST_F(ProtoValueConversionsTest, ExtensionSettingSpecificsToValue) {
TestSpecificsToValue(ExtensionSettingSpecificsToValue);
}
« 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