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

Unified Diff: sync/internal_api/public/sessions/sync_source_info_unittest.cc

Issue 11314008: sync: Follow-up to conflict resolution refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests 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
Index: sync/internal_api/public/sessions/sync_source_info_unittest.cc
diff --git a/sync/internal_api/public/sessions/sync_source_info_unittest.cc b/sync/internal_api/public/sessions/sync_source_info_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8769e8ef8aa48c76e7aac3b57e6f327a63818e8c
--- /dev/null
+++ b/sync/internal_api/public/sessions/sync_source_info_unittest.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sync/internal_api/public/sessions/sync_source_info.h"
+
+#include "base/test/values_test_util.h"
+#include "base/values.h"
+#include "sync/internal_api/public/base/model_type.h"
+#include "sync/internal_api/public/base/model_type_invalidation_map.h"
+#include "sync/protocol/sync.pb.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace syncer {
+namespace sessions {
+namespace {
+
+using base::ExpectDictDictionaryValue;
+using base::ExpectDictStringValue;
+
+class SyncSourceInfoTest : public testing::Test {};
+
+TEST_F(SyncSourceInfoTest, SyncSourceInfoToValue) {
+ sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source =
+ sync_pb::GetUpdatesCallerInfo::PERIODIC;
+ ModelTypeInvalidationMap types;
+ types[PREFERENCES].payload = "preferencespayload";
+ types[EXTENSIONS].payload = "";
+ scoped_ptr<DictionaryValue> expected_types_value(
+ ModelTypeInvalidationMapToValue(types));
+
+ SyncSourceInfo source_info(updates_source, types);
+
+ scoped_ptr<DictionaryValue> value(source_info.ToValue());
+ EXPECT_EQ(2u, value->size());
+ ExpectDictStringValue("PERIODIC", *value, "updatesSource");
+ ExpectDictDictionaryValue(*expected_types_value, *value, "types");
+}
+
+} // namespace syncer
+} // namespace sessions
+} // namespace
« no previous file with comments | « sync/internal_api/public/sessions/sync_session_snapshot_unittest.cc ('k') | sync/internal_api/sync_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698