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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 const int kNumBlockingConflictingUpdates = 1054; | 139 const int kNumBlockingConflictingUpdates = 1054; |
140 const int kNumConflictingUpdates = 1055; | 140 const int kNumConflictingUpdates = 1055; |
141 const bool kDidCommitItems = true; | 141 const bool kDidCommitItems = true; |
142 | 142 |
143 SyncSourceInfo source; | 143 SyncSourceInfo source; |
144 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); | 144 scoped_ptr<DictionaryValue> expected_source_value(source.ToValue()); |
145 | 145 |
146 SyncSessionSnapshot snapshot(syncer_status, | 146 SyncSessionSnapshot snapshot(syncer_status, |
147 errors, | 147 errors, |
148 kNumServerChangesRemaining, | 148 kNumServerChangesRemaining, |
149 kIsShareUsable, | |
150 initial_sync_ended, | 149 initial_sync_ended, |
151 download_progress_markers, | 150 download_progress_markers, |
152 kHasMoreToSync, | 151 kHasMoreToSync, |
153 kIsSilenced, | 152 kIsSilenced, |
154 kUnsyncedCount, | 153 kUnsyncedCount, |
155 kNumBlockingConflictingUpdates, | 154 kNumBlockingConflictingUpdates, |
156 kNumConflictingUpdates, | 155 kNumConflictingUpdates, |
157 kDidCommitItems, | 156 kDidCommitItems, |
158 source, | 157 source, |
159 0, | 158 0, |
160 base::Time::Now(), | 159 base::Time::Now(), |
161 false); | 160 false); |
162 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); | 161 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); |
163 EXPECT_EQ(14u, value->size()); | 162 EXPECT_EQ(14u, value->size()); |
164 ExpectDictDictionaryValue(*expected_syncer_status_value, *value, | 163 ExpectDictDictionaryValue(*expected_syncer_status_value, *value, |
165 "syncerStatus"); | 164 "syncerStatus"); |
166 ExpectDictDictionaryValue(*expected_errors_value, *value, "errors"); | 165 ExpectDictDictionaryValue(*expected_errors_value, *value, "errors"); |
167 ExpectDictIntegerValue(kNumServerChangesRemaining, *value, | 166 ExpectDictIntegerValue(kNumServerChangesRemaining, *value, |
168 "numServerChangesRemaining"); | 167 "numServerChangesRemaining"); |
169 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable"); | |
170 ExpectDictListValue(*expected_initial_sync_ended_value, *value, | 168 ExpectDictListValue(*expected_initial_sync_ended_value, *value, |
171 "initialSyncEnded"); | 169 "initialSyncEnded"); |
172 ExpectDictDictionaryValue(*expected_download_progress_markers_value, | 170 ExpectDictDictionaryValue(*expected_download_progress_markers_value, |
173 *value, "downloadProgressMarkers"); | 171 *value, "downloadProgressMarkers"); |
174 ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync"); | 172 ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync"); |
175 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); | 173 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); |
176 ExpectDictIntegerValue(kUnsyncedCount, *value, "unsyncedCount"); | 174 ExpectDictIntegerValue(kUnsyncedCount, *value, "unsyncedCount"); |
177 ExpectDictIntegerValue(kNumBlockingConflictingUpdates, *value, | 175 ExpectDictIntegerValue(kNumBlockingConflictingUpdates, *value, |
178 "numBlockingConflictingUpdates"); | 176 "numBlockingConflictingUpdates"); |
179 ExpectDictIntegerValue(kNumConflictingUpdates, *value, | 177 ExpectDictIntegerValue(kNumConflictingUpdates, *value, |
180 "numConflictingUpdates"); | 178 "numConflictingUpdates"); |
181 ExpectDictBooleanValue(kDidCommitItems, *value, | 179 ExpectDictBooleanValue(kDidCommitItems, *value, |
182 "didCommitItems"); | 180 "didCommitItems"); |
183 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); | 181 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); |
184 } | 182 } |
185 | 183 |
186 } // namespace | 184 } // namespace |
187 } // namespace sessions | 185 } // namespace sessions |
188 } // namespace browser_sync | 186 } // namespace browser_sync |
OLD | NEW |