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

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

Issue 9348036: Trim code from sync's ServerConnectionManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after Fred's patch Created 8 years, 9 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) 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/prefs/pref_member.h" 5 #include "chrome/browser/prefs/pref_member.h"
6 #include "chrome/browser/prefs/pref_service.h" 6 #include "chrome/browser/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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 144 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
145 145
146 const BookmarkNode* node1 = AddFolder(0, 0, L"title1"); 146 const BookmarkNode* node1 = AddFolder(0, 0, L"title1");
147 SetTitle(0, node1, L"new_title1"); 147 SetTitle(0, node1, L"new_title1");
148 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync.")); 148 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync."));
149 149
150 TriggerAuthError(); 150 TriggerAuthError();
151 151
152 const BookmarkNode* node2 = AddFolder(0, 0, L"title2"); 152 const BookmarkNode* node2 = AddFolder(0, 0, L"title2");
153 SetTitle(0, node2, L"new_title2"); 153 SetTitle(0, node2, L"new_title2");
154 ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Must get auth error.")); 154 ASSERT_TRUE(GetClient(0)->AwaitExponentialBackoffVerification());
155 ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, 155 ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS,
156 GetClient(0)->service()->GetAuthError().state()); 156 GetClient(0)->service()->GetAuthError().state());
157 ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED,
158 GetClient(0)->GetStatus().summary);
159 } 157 }
160 158
161 // TODO(lipalani): Fix the typed_url dtc so this test case can pass. 159 // TODO(lipalani): Fix the typed_url dtc so this test case can pass.
162 IN_PROC_BROWSER_TEST_F(SyncErrorTest, DISABLED_DisableDatatypeWhileRunning) { 160 IN_PROC_BROWSER_TEST_F(SyncErrorTest, DISABLED_DisableDatatypeWhileRunning) {
163 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 161 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
164 syncable::ModelTypeSet synced_datatypes = 162 syncable::ModelTypeSet synced_datatypes =
165 GetClient(0)->service()->GetPreferredDataTypes(); 163 GetClient(0)->service()->GetPreferredDataTypes();
166 ASSERT_TRUE(synced_datatypes.Has(syncable::TYPED_URLS)); 164 ASSERT_TRUE(synced_datatypes.Has(syncable::TYPED_URLS));
167 GetProfile(0)->GetPrefs()->SetBoolean( 165 GetProfile(0)->GetPrefs()->SetBoolean(
168 prefs::kSavingBrowserHistoryDisabled, true); 166 prefs::kSavingBrowserHistoryDisabled, true);
169 167
170 synced_datatypes = GetClient(0)->service()->GetPreferredDataTypes(); 168 synced_datatypes = GetClient(0)->service()->GetPreferredDataTypes();
171 ASSERT_FALSE(synced_datatypes.Has(syncable::TYPED_URLS)); 169 ASSERT_FALSE(synced_datatypes.Has(syncable::TYPED_URLS));
172 170
173 const BookmarkNode* node1 = AddFolder(0, 0, L"title1"); 171 const BookmarkNode* node1 = AddFolder(0, 0, L"title1");
174 SetTitle(0, node1, L"new_title1"); 172 SetTitle(0, node1, L"new_title1");
175 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync.")); 173 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Sync."));
176 // TODO(lipalani)" Verify initial sync ended for typed url is false. 174 // TODO(lipalani)" Verify initial sync ended for typed url is false.
177 } 175 }
178 176
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698