OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 #include "chrome/browser/sync/profile_sync_service_harness.h" | 6 #include "chrome/browser/sync/profile_sync_service_harness.h" |
7 #include "chrome/browser/sync/protocol/sync_protocol_error.h" | 7 #include "chrome/browser/sync/protocol/sync_protocol_error.h" |
8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 8 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
9 #include "chrome/browser/sync/test/integration/passwords_helper.h" | 9 #include "chrome/browser/sync/test/integration/passwords_helper.h" |
10 #include "chrome/browser/sync/test/integration/sync_test.h" | 10 #include "chrome/browser/sync/test/integration/sync_test.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ASSERT_TRUE( | 108 ASSERT_TRUE( |
109 GetClient(0)->AwaitSyncDisabled("Birthday Error.")); | 109 GetClient(0)->AwaitSyncDisabled("Birthday Error.")); |
110 ProfileSyncService::Status status = GetClient(0)->GetStatus(); | 110 ProfileSyncService::Status status = GetClient(0)->GetStatus(); |
111 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); | 111 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); |
112 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); | 112 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); |
113 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); | 113 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); |
114 ASSERT_EQ(status.sync_protocol_error.error_description, | 114 ASSERT_EQ(status.sync_protocol_error.error_description, |
115 protocol_error.error_description); | 115 protocol_error.error_description); |
116 } | 116 } |
117 | 117 |
118 IN_PROC_BROWSER_TEST_F(SyncErrorTest, AuthErrorTest) { | 118 // TODO(rsimha): Enable after fixing crbug.com/107611. |
| 119 IN_PROC_BROWSER_TEST_F(SyncErrorTest, DISABLED_AuthErrorTest) { |
119 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 120 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
120 | 121 |
121 PasswordForm form0 = CreateTestPasswordForm(0); | 122 PasswordForm form0 = CreateTestPasswordForm(0); |
122 AddLogin(GetVerifierPasswordStore(), form0); | 123 AddLogin(GetVerifierPasswordStore(), form0); |
123 ASSERT_EQ(1, GetVerifierPasswordCount()); | 124 ASSERT_EQ(1, GetVerifierPasswordCount()); |
124 AddLogin(GetPasswordStore(0), form0); | 125 AddLogin(GetPasswordStore(0), form0); |
125 ASSERT_EQ(1, GetPasswordCount(0)); | 126 ASSERT_EQ(1, GetPasswordCount(0)); |
126 | 127 |
127 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Added a login.")); | 128 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Added a login.")); |
128 ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); | 129 ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); |
129 ASSERT_EQ(1, GetPasswordCount(0)); | 130 ASSERT_EQ(1, GetPasswordCount(0)); |
130 | 131 |
131 TriggerAuthError(); | 132 TriggerAuthError(); |
132 PasswordForm form1 = CreateTestPasswordForm(1); | 133 PasswordForm form1 = CreateTestPasswordForm(1); |
133 AddLogin(GetPasswordStore(0), form1); | 134 AddLogin(GetPasswordStore(0), form1); |
134 ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Must get auth error.")); | 135 ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Must get auth error.")); |
135 ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, | 136 ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, |
136 GetClient(0)->service()->GetAuthError().state()); | 137 GetClient(0)->service()->GetAuthError().state()); |
137 ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED, | 138 ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED, |
138 GetClient(0)->GetStatus().summary); | 139 GetClient(0)->GetStatus().summary); |
139 } | 140 } |
OLD | NEW |