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

Side by Side Diff: chrome/browser/sync/test/integration/sync_test.cc

Issue 238273008: Add an action for server to send down rollback command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | sync/engine/syncer_proto_util.cc » ('j') | sync/protocol/sync_enums.proto » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/sync/test/integration/sync_test.h" 5 #include "chrome/browser/sync/test/integration/sync_test.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 case syncer::THROTTLED: 908 case syncer::THROTTLED:
909 return sync_pb::SyncEnums::THROTTLED; 909 return sync_pb::SyncEnums::THROTTLED;
910 case syncer::CLEAR_PENDING: 910 case syncer::CLEAR_PENDING:
911 return sync_pb::SyncEnums::CLEAR_PENDING; 911 return sync_pb::SyncEnums::CLEAR_PENDING;
912 case syncer::TRANSIENT_ERROR: 912 case syncer::TRANSIENT_ERROR:
913 return sync_pb::SyncEnums::TRANSIENT_ERROR; 913 return sync_pb::SyncEnums::TRANSIENT_ERROR;
914 case syncer::MIGRATION_DONE: 914 case syncer::MIGRATION_DONE:
915 return sync_pb::SyncEnums::MIGRATION_DONE; 915 return sync_pb::SyncEnums::MIGRATION_DONE;
916 case syncer::UNKNOWN_ERROR: 916 case syncer::UNKNOWN_ERROR:
917 return sync_pb::SyncEnums::UNKNOWN; 917 return sync_pb::SyncEnums::UNKNOWN;
918 default: 918 case syncer::INVALID_CREDENTIAL:
919 NOTREACHED(); 919 return sync_pb::SyncEnums::USER_NOT_ACTIVATED;
Nicolas Zea 2014/04/18 18:06:50 shouldn't this be auth_expired?
haitaol1 2014/04/18 20:01:31 This should be the reverse mapping of ConvertSyncP
920 case syncer::DISABLED_BY_ADMIN:
921 return sync_pb::SyncEnums::DISABLED_BY_ADMIN;
922 case syncer::USER_ROLLBACK:
923 return sync_pb::SyncEnums::USER_ROLLBACK;
924 case syncer::NON_RETRIABLE_ERROR:
920 return sync_pb::SyncEnums::UNKNOWN; 925 return sync_pb::SyncEnums::UNKNOWN;
921 } 926 }
922 } 927 }
923 928
924 sync_pb::SyncEnums::Action GetClientToServerResponseAction( 929 sync_pb::SyncEnums::Action GetClientToServerResponseAction(
925 const syncer::ClientAction& action) { 930 const syncer::ClientAction& action) {
926 switch (action) { 931 switch (action) {
927 case syncer::UPGRADE_CLIENT: 932 case syncer::UPGRADE_CLIENT:
928 return sync_pb::SyncEnums::UPGRADE_CLIENT; 933 return sync_pb::SyncEnums::UPGRADE_CLIENT;
929 case syncer::CLEAR_USER_DATA_AND_RESYNC: 934 case syncer::CLEAR_USER_DATA_AND_RESYNC:
930 return sync_pb::SyncEnums::CLEAR_USER_DATA_AND_RESYNC; 935 return sync_pb::SyncEnums::CLEAR_USER_DATA_AND_RESYNC;
931 case syncer::ENABLE_SYNC_ON_ACCOUNT: 936 case syncer::ENABLE_SYNC_ON_ACCOUNT:
932 return sync_pb::SyncEnums::ENABLE_SYNC_ON_ACCOUNT; 937 return sync_pb::SyncEnums::ENABLE_SYNC_ON_ACCOUNT;
933 case syncer::STOP_AND_RESTART_SYNC: 938 case syncer::STOP_AND_RESTART_SYNC:
934 return sync_pb::SyncEnums::STOP_AND_RESTART_SYNC; 939 return sync_pb::SyncEnums::STOP_AND_RESTART_SYNC;
935 case syncer::DISABLE_SYNC_ON_CLIENT: 940 case syncer::DISABLE_SYNC_ON_CLIENT:
936 return sync_pb::SyncEnums::DISABLE_SYNC_ON_CLIENT; 941 return sync_pb::SyncEnums::DISABLE_SYNC_ON_CLIENT;
942 case syncer::STOP_SYNC_FOR_DISABLED_ACCOUNT:
943 return sync_pb::SyncEnums::DISABLED_BY_ADMIN;
944 case syncer::USER_ROLLBACK:
Nicolas Zea 2014/04/18 18:06:50 Shouldn't this case lead to DISABLE_SYNC_AND_ROLLB
haitaol1 2014/04/18 20:01:31 I didn't add corresponding action in sync proto be
937 case syncer::UNKNOWN_ACTION: 945 case syncer::UNKNOWN_ACTION:
938 return sync_pb::SyncEnums::UNKNOWN_ACTION; 946 return sync_pb::SyncEnums::UNKNOWN_ACTION;
939 default:
940 NOTREACHED();
941 return sync_pb::SyncEnums::UNKNOWN_ACTION;
942 } 947 }
943 } 948 }
944 949
945 } // namespace 950 } // namespace
946 951
947 void SyncTest::TriggerSyncError(const syncer::SyncProtocolError& error, 952 void SyncTest::TriggerSyncError(const syncer::SyncProtocolError& error,
948 SyncErrorFrequency frequency) { 953 SyncErrorFrequency frequency) {
949 ASSERT_TRUE(ServerSupportsErrorTriggering()); 954 ASSERT_TRUE(ServerSupportsErrorTriggering());
950 std::string path = "chromiumsync/error"; 955 std::string path = "chromiumsync/error";
951 int error_type = 956 int error_type =
(...skipping 28 matching lines...) Expand all
980 985
981 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, 986 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter,
982 const net::ProxyConfig& proxy_config) { 987 const net::ProxyConfig& proxy_config) {
983 base::WaitableEvent done(false, false); 988 base::WaitableEvent done(false, false);
984 BrowserThread::PostTask( 989 BrowserThread::PostTask(
985 BrowserThread::IO, FROM_HERE, 990 BrowserThread::IO, FROM_HERE,
986 base::Bind(&SetProxyConfigCallback, &done, 991 base::Bind(&SetProxyConfigCallback, &done,
987 make_scoped_refptr(context_getter), proxy_config)); 992 make_scoped_refptr(context_getter), proxy_config));
988 done.Wait(); 993 done.Wait();
989 } 994 }
OLDNEW
« no previous file with comments | « no previous file | sync/engine/syncer_proto_util.cc » ('j') | sync/protocol/sync_enums.proto » ('J')

Powered by Google App Engine
This is Rietveld 408576698