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

Side by Side Diff: chrome/browser/sync/sessions/session_state_unittest.cc

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
11 #include "base/time.h"
11 #include "base/values.h" 12 #include "base/values.h"
12 #include "chrome/test/base/values_test_util.h" 13 #include "chrome/test/base/values_test_util.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace browser_sync { 16 namespace browser_sync {
16 namespace sessions { 17 namespace sessions {
17 namespace { 18 namespace {
18 19
19 using test::ExpectDictBooleanValue; 20 using test::ExpectDictBooleanValue;
20 using test::ExpectDictDictionaryValue; 21 using test::ExpectDictDictionaryValue;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 kIsShareUsable, 154 kIsShareUsable,
154 initial_sync_ended, 155 initial_sync_ended,
155 download_progress_markers, 156 download_progress_markers,
156 kHasMoreToSync, 157 kHasMoreToSync,
157 kIsSilenced, 158 kIsSilenced,
158 kUnsyncedCount, 159 kUnsyncedCount,
159 kNumBlockingConflictingUpdates, 160 kNumBlockingConflictingUpdates,
160 kNumConflictingUpdates, 161 kNumConflictingUpdates,
161 kDidCommitItems, 162 kDidCommitItems,
162 source, 163 source,
163 0); 164 0,
165 base::Time::Now());
164 scoped_ptr<DictionaryValue> value(snapshot.ToValue()); 166 scoped_ptr<DictionaryValue> value(snapshot.ToValue());
165 EXPECT_EQ(14u, value->size()); 167 EXPECT_EQ(14u, value->size());
166 ExpectDictDictionaryValue(*expected_syncer_status_value, *value, 168 ExpectDictDictionaryValue(*expected_syncer_status_value, *value,
167 "syncerStatus"); 169 "syncerStatus");
168 ExpectDictDictionaryValue(*expected_errors_value, *value, "errors"); 170 ExpectDictDictionaryValue(*expected_errors_value, *value, "errors");
169 ExpectDictIntegerValue(kNumServerChangesRemaining, *value, 171 ExpectDictIntegerValue(kNumServerChangesRemaining, *value,
170 "numServerChangesRemaining"); 172 "numServerChangesRemaining");
171 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable"); 173 ExpectDictBooleanValue(kIsShareUsable, *value, "isShareUsable");
172 ExpectDictListValue(*expected_initial_sync_ended_value, *value, 174 ExpectDictListValue(*expected_initial_sync_ended_value, *value,
173 "initialSyncEnded"); 175 "initialSyncEnded");
174 ExpectDictDictionaryValue(*expected_download_progress_markers_value, 176 ExpectDictDictionaryValue(*expected_download_progress_markers_value,
175 *value, "downloadProgressMarkers"); 177 *value, "downloadProgressMarkers");
176 ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync"); 178 ExpectDictBooleanValue(kHasMoreToSync, *value, "hasMoreToSync");
177 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced"); 179 ExpectDictBooleanValue(kIsSilenced, *value, "isSilenced");
178 ExpectDictIntegerValue(kUnsyncedCount, *value, "unsyncedCount"); 180 ExpectDictIntegerValue(kUnsyncedCount, *value, "unsyncedCount");
179 ExpectDictIntegerValue(kNumBlockingConflictingUpdates, *value, 181 ExpectDictIntegerValue(kNumBlockingConflictingUpdates, *value,
180 "numBlockingConflictingUpdates"); 182 "numBlockingConflictingUpdates");
181 ExpectDictIntegerValue(kNumConflictingUpdates, *value, 183 ExpectDictIntegerValue(kNumConflictingUpdates, *value,
182 "numConflictingUpdates"); 184 "numConflictingUpdates");
183 ExpectDictBooleanValue(kDidCommitItems, *value, 185 ExpectDictBooleanValue(kDidCommitItems, *value,
184 "didCommitItems"); 186 "didCommitItems");
185 ExpectDictDictionaryValue(*expected_source_value, *value, "source"); 187 ExpectDictDictionaryValue(*expected_source_value, *value, "source");
186 } 188 }
187 189
188 } // namespace 190 } // namespace
189 } // namespace sessions 191 } // namespace sessions
190 } // namespace browser_sync 192 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698