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

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

Issue 8931013: Sync integration test for authentication errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "" Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_test.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) 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/sync_test.h" 10 #include "chrome/browser/sync/test/integration/sync_test.h"
10 11
11 using bookmarks_helper::AddFolder; 12 using bookmarks_helper::AddFolder;
12 using bookmarks_helper::SetTitle; 13 using bookmarks_helper::SetTitle;
14 using passwords_helper::AddLogin;
15 using passwords_helper::CreateTestPasswordForm;
16 using passwords_helper::GetPasswordCount;
17 using passwords_helper::GetPasswordStore;
18 using passwords_helper::GetVerifierPasswordCount;
19 using passwords_helper::GetVerifierPasswordStore;
20 using passwords_helper::ProfileContainsSamePasswordFormsAsVerifier;
21
22 using webkit_glue::PasswordForm;
13 23
14 class SyncErrorTest : public SyncTest{ 24 class SyncErrorTest : public SyncTest{
15 public: 25 public:
16 SyncErrorTest() : SyncTest(SINGLE_CLIENT) {} 26 SyncErrorTest() : SyncTest(SINGLE_CLIENT) {}
17 virtual ~SyncErrorTest() {} 27 virtual ~SyncErrorTest() {}
18 28
19 private: 29 private:
20 DISALLOW_COPY_AND_ASSIGN(SyncErrorTest); 30 DISALLOW_COPY_AND_ASSIGN(SyncErrorTest);
21 }; 31 };
22 32
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 SetTitle(0, node2, L"new_title2"); 106 SetTitle(0, node2, L"new_title2");
97 ASSERT_TRUE( 107 ASSERT_TRUE(
98 GetClient(0)->AwaitSyncDisabled("Birthday Error.")); 108 GetClient(0)->AwaitSyncDisabled("Birthday Error."));
99 ProfileSyncService::Status status = GetClient(0)->GetStatus(); 109 ProfileSyncService::Status status = GetClient(0)->GetStatus();
100 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type); 110 ASSERT_EQ(status.sync_protocol_error.error_type, protocol_error.error_type);
101 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action); 111 ASSERT_EQ(status.sync_protocol_error.action, protocol_error.action);
102 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url); 112 ASSERT_EQ(status.sync_protocol_error.url, protocol_error.url);
103 ASSERT_EQ(status.sync_protocol_error.error_description, 113 ASSERT_EQ(status.sync_protocol_error.error_description,
104 protocol_error.error_description); 114 protocol_error.error_description);
105 } 115 }
116
117 IN_PROC_BROWSER_TEST_F(SyncErrorTest, AuthErrorTest) {
118 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
119
120 PasswordForm form0 = CreateTestPasswordForm(0);
121 AddLogin(GetVerifierPasswordStore(), form0);
122 ASSERT_EQ(1, GetVerifierPasswordCount());
123 AddLogin(GetPasswordStore(0), form0);
124 ASSERT_EQ(1, GetPasswordCount(0));
125
126 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Added a login."));
127 ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0));
128 ASSERT_EQ(1, GetPasswordCount(0));
129
130 TriggerAuthError();
131 PasswordForm form1 = CreateTestPasswordForm(1);
132 AddLogin(GetPasswordStore(0), form1);
133 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.
134 ASSERT_EQ(ProfileSyncService::Status::OFFLINE_UNSYNCED,
135 GetClient(0)->GetStatus().summary);
136 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/sync_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698