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

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

Issue 11416126: Track merged nudge sources (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments 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
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 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" 5 #include "sync/internal_api/public/sessions/sync_session_snapshot.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/test/values_test_util.h" 8 #include "base/test/values_test_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "sync/internal_api/public/sessions/sync_source_info.h" 10 #include "sync/internal_api/public/sessions/sync_source_info.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ProgressMarkerMapToValue(download_progress_markers)); 46 ProgressMarkerMapToValue(download_progress_markers));
47 47
48 const bool kIsSilenced = true; 48 const bool kIsSilenced = true;
49 const int kNumEncryptionConflicts = 1054; 49 const int kNumEncryptionConflicts = 1054;
50 const int kNumHierarchyConflicts = 1055; 50 const int kNumHierarchyConflicts = 1055;
51 const int kNumServerConflicts = 1057; 51 const int kNumServerConflicts = 1057;
52 52
53 SyncSourceInfo source; 53 SyncSourceInfo source;
54 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); 54 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue());
55 55
56 std::vector<SyncSourceInfo> debug_info_sources_list;
57 debug_info_sources_list.push_back(source);
58 scoped_ptr<ListValue> expected_sources_list_value(new ListValue());
59 expected_sources_list_value->Append(source.ToValue());
60
56 SyncSessionSnapshot snapshot(model_neutral, 61 SyncSessionSnapshot snapshot(model_neutral,
57 kIsShareUsable, 62 kIsShareUsable,
58 initial_sync_ended, 63 initial_sync_ended,
59 download_progress_markers, 64 download_progress_markers,
60 kIsSilenced, 65 kIsSilenced,
61 kNumEncryptionConflicts, 66 kNumEncryptionConflicts,
62 kNumHierarchyConflicts, 67 kNumHierarchyConflicts,
63 kNumServerConflicts, 68 kNumServerConflicts,
64 source, 69 source,
70 debug_info_sources_list,
65 false, 71 false,
66 0, 72 0,
67 base::Time::Now(), 73 base::Time::Now(),
68 std::vector<int>(MODEL_TYPE_COUNT,0), 74 std::vector<int>(MODEL_TYPE_COUNT,0),
69 std::vector<int>(MODEL_TYPE_COUNT, 0)); 75 std::vector<int>(MODEL_TYPE_COUNT, 0));
70 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); 76 scoped_ptr<DictionaryValue> value(snapshot.ToValue());
71 EXPECT_EQ(19u, value->size()); 77 EXPECT_EQ(20u, value->size());
72 ExpectDictIntegerValue(model_neutral.num_successful_commits, 78 ExpectDictIntegerValue(model_neutral.num_successful_commits,
73 *value, "numSuccessfulCommits"); 79 *value, "numSuccessfulCommits");
74 ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits, 80 ExpectDictIntegerValue(model_neutral.num_successful_bookmark_commits,
75 *value, "numSuccessfulBookmarkCommits"); 81 *value, "numSuccessfulBookmarkCommits");
76 ExpectDictIntegerValue(model_neutral.num_updates_downloaded_total, 82 ExpectDictIntegerValue(model_neutral.num_updates_downloaded_total,
77 *value, "numUpdatesDownloadedTotal"); 83 *value, "numUpdatesDownloadedTotal");
78 ExpectDictIntegerValue(model_neutral.num_tombstone_updates_downloaded_total, 84 ExpectDictIntegerValue(model_neutral.num_tombstone_updates_downloaded_total,
79 *value, "numTombstoneUpdatesDownloadedTotal"); 85 *value, "numTombstoneUpdatesDownloadedTotal");
80 ExpectDictIntegerValue(model_neutral.num_reflected_updates_downloaded_total, 86 ExpectDictIntegerValue(model_neutral.num_reflected_updates_downloaded_total,
81 *value, "numReflectedUpdatesDownloadedTotal"); 87 *value, "numReflectedUpdatesDownloadedTotal");
82 ExpectDictIntegerValue(model_neutral.num_local_overwrites, 88 ExpectDictIntegerValue(model_neutral.num_local_overwrites,
83 *value, "numLocalOverwrites"); 89 *value, "numLocalOverwrites");
84 ExpectDictIntegerValue(model_neutral.num_server_overwrites, 90 ExpectDictIntegerValue(model_neutral.num_server_overwrites,
85 *value, "numServerOverwrites"); 91 *value, "numServerOverwrites");
86 ExpectDictIntegerValue(model_neutral.num_server_changes_remaining, 92 ExpectDictIntegerValue(model_neutral.num_server_changes_remaining,
87 *value, "numServerChangesRemaining"); 93 *value, "numServerChangesRemaining");
88 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable"); 94 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable");
89 ExpectDictListValue(*expected_initial_sync_ended_value, *value, 95 ExpectDictListValue(*expected_initial_sync_ended_value, *value,
90 "initialSyncEnded"); 96 "initialSyncEnded");
91 ExpectDictDictionaryValue(*expected_download_progress_markers_value, 97 ExpectDictDictionaryValue(*expected_download_progress_markers_value,
92 *value, "downloadProgressMarkers"); 98 *value, "downloadProgressMarkers");
93 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); 99 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced");
94 ExpectDictIntegerValue(kNumEncryptionConflicts, *value, 100 ExpectDictIntegerValue(kNumEncryptionConflicts, *value,
95 "numEncryptionConflicts"); 101 "numEncryptionConflicts");
96 ExpectDictIntegerValue(kNumHierarchyConflicts, *value, 102 ExpectDictIntegerValue(kNumHierarchyConflicts, *value,
97 "numHierarchyConflicts"); 103 "numHierarchyConflicts");
98 ExpectDictIntegerValue(kNumServerConflicts, *value, 104 ExpectDictIntegerValue(kNumServerConflicts, *value,
99 "numServerConflicts"); 105 "numServerConflicts");
100 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); 106 ExpectDictDictionaryValue(*expected_source_value, *value, "source");
107 ExpectDictListValue(*expected_sources_list_value, *value, "sourcesList");
101 ExpectDictBooleanValue(false, *value, "notificationsEnabled"); 108 ExpectDictBooleanValue(false, *value, "notificationsEnabled");
102 } 109 }
103 110
104 } // namespace 111 } // namespace
105 } // namespace sessions 112 } // namespace sessions
106 } // namespace syncer 113 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698