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

Side by Side 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, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "sync/internal_api/public/sessions/sync_source_info.h"
6
7 #include "base/test/values_test_util.h"
8 #include "base/values.h"
9 #include "sync/internal_api/public/base/model_type.h"
10 #include "sync/internal_api/public/base/model_type_invalidation_map.h"
11 #include "sync/protocol/sync.pb.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace syncer {
15 namespace sessions {
16 namespace {
17
18 using base::ExpectDictDictionaryValue;
19 using base::ExpectDictStringValue;
20
21 class SyncSourceInfoTest : public testing::Test {};
22
23 TEST_F(SyncSourceInfoTest, SyncSourceInfoToValue) {
24 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source =
25 sync_pb::GetUpdatesCallerInfo::PERIODIC;
26 ModelTypeInvalidationMap types;
27 types[PREFERENCES].payload = "preferencespayload";
28 types[EXTENSIONS].payload = "";
29 scoped_ptr<DictionaryValue> expected_types_value(
30 ModelTypeInvalidationMapToValue(types));
31
32 SyncSourceInfo source_info(updates_source, types);
33
34 scoped_ptr<DictionaryValue> value(source_info.ToValue());
35 EXPECT_EQ(2u, value->size());
36 ExpectDictStringValue("PERIODIC", *value, "updatesSource");
37 ExpectDictDictionaryValue(*expected_types_value, *value, "types");
38 }
39
40 } // namespace syncer
41 } // namespace sessions
42 } // namespace
OLDNEW
« 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