OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |