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

Side by Side Diff: sync/internal_api/public/sessions/sync_source_info_unittest.cc

Issue 19982002: sync: Remove SyncSourceInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Convert SyncShareRecords to typedef Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/public/sessions/sync_source_info.cc ('k') | sync/sessions/nudge_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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<base::DictionaryValue> expected_types_value(
30 ModelTypeInvalidationMapToValue(types));
31
32 SyncSourceInfo source_info(updates_source, types);
33
34 scoped_ptr<base::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_source_info.cc ('k') | sync/sessions/nudge_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698