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

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

Issue 13743003: sync: Finish the SyncScheduler refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix AuthErrorTest Created 7 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | sync/engine/sync_scheduler_impl.h » ('j') | no next file with comments »
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 "base/prefs/pref_member.h" 5 #include "base/prefs/pref_member.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "chrome/browser/sync/profile_sync_service.h" 7 #include "chrome/browser/sync/profile_sync_service.h"
8 #include "chrome/browser/sync/profile_sync_service_harness.h" 8 #include "chrome/browser/sync/profile_sync_service_harness.h"
9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" 9 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
10 #include "chrome/browser/sync/test/integration/passwords_helper.h" 10 #include "chrome/browser/sync/test/integration/passwords_helper.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 ASSERT_TRUE( 133 ASSERT_TRUE(
134 GetClient(0)->AwaitSyncDisabled("Birthday Error.")); 134 GetClient(0)->AwaitSyncDisabled("Birthday Error."));
135 ProfileSyncService::Status status = GetClient(0)->GetStatus(); 135 ProfileSyncService::Status status = GetClient(0)->GetStatus();
136 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); 136 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type);
137 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); 137 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action);
138 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); 138 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url);
139 ASSERT_EQ(status.sync_protocol_error.error_description, 139 ASSERT_EQ(status.sync_protocol_error.error_description,
140 protocol_error.error_description); 140 protocol_error.error_description);
141 } 141 }
142 142
143 // Trigger an auth error and make sure the sync client detects it when 143 // Trigger an auth error and make sure the sync client displays a warning in the
144 // trying to commit. 144 // UI.
145 IN_PROC_BROWSER_TEST_F(SyncErrorTest, AuthErrorTest) { 145 IN_PROC_BROWSER_TEST_F(SyncErrorTest, AuthErrorTest) {
146 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 146 ASSERT_TRUE(SetupClients());
147
148 const BookmarkNode* node1 = AddFolder(0, 0, L"title1");
149 SetTitle(0, node1, L"new_title1");
150 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync."));
151
152 TriggerAuthError(); 147 TriggerAuthError();
153 148
154 const BookmarkNode* node2 = AddFolder(0, 0, L"title2"); 149 ASSERT_FALSE(GetClient(0)->SetupSync());
155 SetTitle(0, node2, L"new_title2");
156 ASSERT_TRUE(GetClient(0)->AwaitExponentialBackoffVerification());
157 ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, 150 ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
158 GetClient(0)->service()->GetAuthError().state()); 151 GetClient(0)->service()->GetAuthError().state());
159 } 152 }
160 153
161 // Trigger an XMPP auth error, and make sure sync treats it like any 154 // Trigger an XMPP auth error, and make sure sync treats it like any
162 // other auth error. 155 // other auth error.
163 IN_PROC_BROWSER_TEST_F(SyncErrorTest, XmppAuthErrorTest) { 156 IN_PROC_BROWSER_TEST_F(SyncErrorTest, XmppAuthErrorTest) {
164 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; 157 ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
165 158
166 TriggerXmppAuthError(); 159 TriggerXmppAuthError();
(...skipping 15 matching lines...) Expand all
182 175
183 synced_datatypes = GetClient(0)->service()->GetPreferredDataTypes(); 176 synced_datatypes = GetClient(0)->service()->GetPreferredDataTypes();
184 ASSERT_FALSE(synced_datatypes.Has(syncer::TYPED_URLS)); 177 ASSERT_FALSE(synced_datatypes.Has(syncer::TYPED_URLS));
185 178
186 const BookmarkNode* node1 = AddFolder(0, 0, L"title1"); 179 const BookmarkNode* node1 = AddFolder(0, 0, L"title1");
187 SetTitle(0, node1, L"new_title1"); 180 SetTitle(0, node1, L"new_title1");
188 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync.")); 181 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync."));
189 // TODO(lipalani)" Verify initial sync ended for typed url is false. 182 // TODO(lipalani)" Verify initial sync ended for typed url is false.
190 } 183 }
191 184
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | sync/engine/sync_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698