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

Side by Side Diff: chrome/browser/sync/engine/syncer_proto_util_unittest.cc

Issue 7621085: Server directed error handling backend code. (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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/engine/syncer_proto_util.h" 5 #include "chrome/browser/sync/engine/syncer_proto_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "chrome/browser/sync/engine/syncproto.h" 10 #include "chrome/browser/sync/engine/syncproto.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 dcm.set_send_error(false); 231 dcm.set_send_error(false);
232 EXPECT_TRUE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, 232 EXPECT_TRUE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL,
233 msg, &response)); 233 msg, &response));
234 234
235 dcm.set_access_denied(true); 235 dcm.set_access_denied(true);
236 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL, 236 EXPECT_FALSE(SyncerProtoUtil::PostAndProcessHeaders(&dcm, NULL,
237 msg, &response)); 237 msg, &response));
238 } 238 }
239 239
240 TEST_F(SyncerProtoUtilTest, ShouldRequestEarlyExit) {
241 sync_api::SyncError error;
242
243 error.error_type = sync_api::SUCCESS;
244 EXPECT_FALSE(browser_sync::ShouldRequestEarlyExit(error));
245
246 error.error_type = sync_api::MIGRATION_DONE;
247 EXPECT_FALSE(browser_sync::ShouldRequestEarlyExit(error));
248
249 error.error_type = sync_api::NOT_MY_BIRTHDAY;
250 EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
251
252 error.error_type = sync_api::THROTTLED;
253 EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
254
255 error.error_type = sync_api::CLEAR_PENDING;
256 EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
257
258 error.error_type = sync_api::TRANSIENT_ERROR;
259 EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
260
261 error.error_type = sync_api::INVALID_CREDENTIAL;
262 EXPECT_TRUE(browser_sync::ShouldRequestEarlyExit(error));
263 }
264
240 } // namespace browser_sync 265 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698