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

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

Issue 10696087: [Sync] Move ModelType and related classes to 'syncer' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort headers, update copyrights Created 8 years, 5 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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.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/test/integration/passwords_helper.h" 7 #include "chrome/browser/sync/test/integration/passwords_helper.h"
8 #include "chrome/browser/sync/test/integration/sync_test.h" 8 #include "chrome/browser/sync/test/integration/sync_test.h"
9 #include "sync/internal_api/public/engine/model_safe_worker.h" 9 #include "sync/internal_api/public/engine/model_safe_worker.h"
10 #include "sync/internal_api/public/sessions/sync_session_snapshot.h" 10 #include "sync/internal_api/public/sessions/sync_session_snapshot.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 ASSERT_TRUE(AwaitQuiescence()); 67 ASSERT_TRUE(AwaitQuiescence());
68 ASSERT_TRUE(AllProfilesContainSamePasswordForms()); 68 ASSERT_TRUE(AllProfilesContainSamePasswordForms());
69 } 69 }
70 70
71 // TCM ID - 4577932. 71 // TCM ID - 4577932.
72 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) { 72 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) {
73 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 73 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
74 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); 74 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier());
75 75
76 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::PASSWORDS)); 76 ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::PASSWORDS));
77 PasswordForm form = CreateTestPasswordForm(0); 77 PasswordForm form = CreateTestPasswordForm(0);
78 AddLogin(GetVerifierPasswordStore(), form); 78 AddLogin(GetVerifierPasswordStore(), form);
79 ASSERT_EQ(1, GetVerifierPasswordCount()); 79 ASSERT_EQ(1, GetVerifierPasswordCount());
80 AddLogin(GetPasswordStore(0), form); 80 AddLogin(GetPasswordStore(0), form);
81 ASSERT_EQ(1, GetPasswordCount(0)); 81 ASSERT_EQ(1, GetPasswordCount(0));
82 82
83 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 83 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
84 ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); 84 ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0));
85 ASSERT_FALSE(ProfileContainsSamePasswordFormsAsVerifier(1)); 85 ASSERT_FALSE(ProfileContainsSamePasswordFormsAsVerifier(1));
86 86
87 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::PASSWORDS)); 87 ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::PASSWORDS));
88 ASSERT_TRUE(AwaitQuiescence()); 88 ASSERT_TRUE(AwaitQuiescence());
89 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); 89 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier());
90 ASSERT_EQ(1, GetPasswordCount(1)); 90 ASSERT_EQ(1, GetPasswordCount(1));
91 } 91 }
92 92
93 // TCM ID - 4649281. 93 // TCM ID - 4649281.
94 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisableSync) { 94 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisableSync) {
95 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 95 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
96 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); 96 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier());
97 97
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 ASSERT_FALSE(GetClient(1)->SetupSync()); 248 ASSERT_FALSE(GetClient(1)->SetupSync());
249 ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); 249 ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired());
250 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); 250 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase));
251 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); 251 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted());
252 ASSERT_TRUE(GetClient(1)->AwaitFullSyncCompletion("Initial sync.")); 252 ASSERT_TRUE(GetClient(1)->AwaitFullSyncCompletion("Initial sync."));
253 253
254 // Following ensures types are enabled and active (see bug 87572). 254 // Following ensures types are enabled and active (see bug 87572).
255 syncer::ModelSafeRoutingInfo routes; 255 syncer::ModelSafeRoutingInfo routes;
256 GetClient(0)->service()->GetModelSafeRoutingInfo(&routes); 256 GetClient(0)->service()->GetModelSafeRoutingInfo(&routes);
257 ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncable::PASSWORDS]); 257 ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncer::PASSWORDS]);
258 routes.clear(); 258 routes.clear();
259 GetClient(1)->service()->GetModelSafeRoutingInfo(&routes); 259 GetClient(1)->service()->GetModelSafeRoutingInfo(&routes);
260 ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncable::PASSWORDS]); 260 ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncer::PASSWORDS]);
261 } 261 }
262 262
263 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, 263 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest,
264 SetDifferentPassphraseAndThenSetupSync) { 264 SetDifferentPassphraseAndThenSetupSync) {
265 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; 265 ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
266 266
267 ASSERT_TRUE(GetClient(0)->SetupSync()); 267 ASSERT_TRUE(GetClient(0)->SetupSync());
268 SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); 268 SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT);
269 ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); 269 ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted());
270 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Initial sync.")); 270 ASSERT_TRUE(GetClient(0)->AwaitFullSyncCompletion("Initial sync."));
(...skipping 15 matching lines...) Expand all
286 ASSERT_FALSE(AllProfilesContainSamePasswordFormsAsVerifier()); 286 ASSERT_FALSE(AllProfilesContainSamePasswordFormsAsVerifier());
287 287
288 // Update 1 with the correct passphrase, the password should now sync over. 288 // Update 1 with the correct passphrase, the password should now sync over.
289 ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired()); 289 ASSERT_TRUE(GetClient(1)->AwaitPassphraseRequired());
290 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); 290 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase));
291 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); 291 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted());
292 292
293 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); 293 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
294 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); 294 ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier());
295 } 295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698