Chromium Code Reviews| Index: chrome/browser/sync/test/integration/sync_errors_test.cc |
| diff --git a/chrome/browser/sync/test/integration/sync_errors_test.cc b/chrome/browser/sync/test/integration/sync_errors_test.cc |
| index 6254efdf48713d7fb43310ff631c9d2e795fd94b..a1c20bab796a05717b176a43bb2fa668827009c3 100644 |
| --- a/chrome/browser/sync/test/integration/sync_errors_test.cc |
| +++ b/chrome/browser/sync/test/integration/sync_errors_test.cc |
| @@ -6,10 +6,20 @@ |
| #include "chrome/browser/sync/profile_sync_service_harness.h" |
| #include "chrome/browser/sync/protocol/sync_protocol_error.h" |
| #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
| +#include "chrome/browser/sync/test/integration/passwords_helper.h" |
| #include "chrome/browser/sync/test/integration/sync_test.h" |
| using bookmarks_helper::AddFolder; |
| using bookmarks_helper::SetTitle; |
| +using passwords_helper::AddLogin; |
| +using passwords_helper::CreateTestPasswordForm; |
| +using passwords_helper::GetPasswordCount; |
| +using passwords_helper::GetPasswordStore; |
| +using passwords_helper::GetVerifierPasswordCount; |
| +using passwords_helper::GetVerifierPasswordStore; |
| +using passwords_helper::ProfileContainsSamePasswordFormsAsVerifier; |
| + |
| +using webkit_glue::PasswordForm; |
| class SyncErrorTest : public SyncTest{ |
| public: |
| @@ -103,3 +113,24 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, |
| ASSERT_EQ(status.sync_protocol_error.error_description, |
| protocol_error.error_description); |
| } |
| + |
| +IN_PROC_BROWSER_TEST_F(SyncErrorTest, AuthErrorTest) { |
| + ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| + |
| + PasswordForm form0 = CreateTestPasswordForm(0); |
| + AddLogin(GetVerifierPasswordStore(), form0); |
| + ASSERT_EQ(1, GetVerifierPasswordCount()); |
| + AddLogin(GetPasswordStore(0), form0); |
| + ASSERT_EQ(1, GetPasswordCount(0)); |
| + |
| + ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Added a login.")); |
| + ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); |
| + ASSERT_EQ(1, GetPasswordCount(0)); |
| + |
| + TriggerAuthError(); |
| + PasswordForm form1 = CreateTestPasswordForm(1); |
| + AddLogin(GetPasswordStore(0), form1); |
| + ASSERT_FALSE(GetClient(0)->AwaitFullSyncCompletion("Must get auth error.")); |
|
lipalani1
2011/12/14 00:30:36
You can check the PSS last_auth_error_ variable. i
Raghu Simha
2011/12/14 02:17:09
Great idea. Done.
|
| + ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED, |
| + GetClient(0)->GetStatus().summary); |
| +} |