OLD | NEW |
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 "chrome/browser/sync/sessions/session_state.h" | 5 #include "chrome/browser/sync/sessions/session_state.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; | 124 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; |
125 download_progress_markers[syncable::BOOKMARKS] = "test"; | 125 download_progress_markers[syncable::BOOKMARKS] = "test"; |
126 download_progress_markers[syncable::APPS] = "apps"; | 126 download_progress_markers[syncable::APPS] = "apps"; |
127 scoped_ptr<DictionaryValue> expected_download_progress_markers_value( | 127 scoped_ptr<DictionaryValue> expected_download_progress_markers_value( |
128 DownloadProgressMarkersToValue(download_progress_markers)); | 128 DownloadProgressMarkersToValue(download_progress_markers)); |
129 | 129 |
130 const bool kHasMoreToSync = false; | 130 const bool kHasMoreToSync = false; |
131 const bool kIsSilenced = true; | 131 const bool kIsSilenced = true; |
132 const int kUnsyncedCount = 1053; | 132 const int kUnsyncedCount = 1053; |
133 const int kNumBlockingConflictingUpdates = 1054; | 133 const int kNumSimpleConflictingUpdates = 1054; |
134 const int kNumConflictingUpdates = 1055; | 134 const int kNumConflictingUpdates = 1055; |
135 const bool kDidCommitItems = true; | 135 const bool kDidCommitItems = true; |
136 | 136 |
137 SyncSourceInfo source; | 137 SyncSourceInfo source; |
138 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); | 138 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); |
139 | 139 |
140 SyncSessionSnapshot snapshot(syncer_status, | 140 SyncSessionSnapshot snapshot(syncer_status, |
141 errors, | 141 errors, |
142 kNumServerChangesRemaining, | 142 kNumServerChangesRemaining, |
143 kIsShareUsable, | 143 kIsShareUsable, |
144 initial_sync_ended, | 144 initial_sync_ended, |
145 download_progress_markers, | 145 download_progress_markers, |
146 kHasMoreToSync, | 146 kHasMoreToSync, |
147 kIsSilenced, | 147 kIsSilenced, |
148 kUnsyncedCount, | 148 kUnsyncedCount, |
149 kNumBlockingConflictingUpdates, | 149 kNumSimpleConflictingUpdates, |
150 kNumConflictingUpdates, | 150 kNumConflictingUpdates, |
151 kDidCommitItems, | 151 kDidCommitItems, |
152 source, | 152 source, |
153 0, | 153 0, |
154 base::Time::Now(), | 154 base::Time::Now(), |
155 false); | 155 false); |
156 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); | 156 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); |
157 EXPECT_EQ(14u, value->size()); | 157 EXPECT_EQ(14u, value->size()); |
158 ExpectDictDictionaryValue(*expected_syncer_status_value, *value, | 158 ExpectDictDictionaryValue(*expected_syncer_status_value, *value, |
159 "syncerStatus"); | 159 "syncerStatus"); |
160 ExpectDictDictionaryValue(*expected_errors_value, *value, "errors"); | 160 ExpectDictDictionaryValue(*expected_errors_value, *value, "errors"); |
161 ExpectDictIntegerValue(kNumServerChangesRemaining, *value, | 161 ExpectDictIntegerValue(kNumServerChangesRemaining, *value, |
162 "numServerChangesRemaining"); | 162 "numServerChangesRemaining"); |
163 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable"); | 163 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable"); |
164 ExpectDictListValue(*expected_initial_sync_ended_value, *value, | 164 ExpectDictListValue(*expected_initial_sync_ended_value, *value, |
165 "initialSyncEnded"); | 165 "initialSyncEnded"); |
166 ExpectDictDictionaryValue(*expected_download_progress_markers_value, | 166 ExpectDictDictionaryValue(*expected_download_progress_markers_value, |
167 *value, "downloadProgressMarkers"); | 167 *value, "downloadProgressMarkers"); |
168 ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync"); | 168 ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync"); |
169 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); | 169 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); |
170 ExpectDictIntegerValue(kUnsyncedCount, *value, "unsyncedCount"); | 170 ExpectDictIntegerValue(kUnsyncedCount, *value, "unsyncedCount"); |
171 ExpectDictIntegerValue(kNumBlockingConflictingUpdates, *value, | 171 ExpectDictIntegerValue(kNumSimpleConflictingUpdates, *value, |
172 "numBlockingConflictingUpdates"); | 172 "numSimpleConflictingUpdates"); |
173 ExpectDictIntegerValue(kNumConflictingUpdates, *value, | 173 ExpectDictIntegerValue(kNumConflictingUpdates, *value, |
174 "numConflictingUpdates"); | 174 "numConflictingUpdates"); |
175 ExpectDictBooleanValue(kDidCommitItems, *value, | 175 ExpectDictBooleanValue(kDidCommitItems, *value, |
176 "didCommitItems"); | 176 "didCommitItems"); |
177 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); | 177 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); |
178 } | 178 } |
179 | 179 |
180 } // namespace | 180 } // namespace |
181 } // namespace sessions | 181 } // namespace sessions |
182 } // namespace browser_sync | 182 } // namespace browser_sync |
OLD | NEW |