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

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

Issue 10833004: [Sync] Make P2PNotifier emit a notification only if some enabled types changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed MC_DeleteBookmarks Created 8 years, 4 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(syncer::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)->AwaitFullSyncCompletion("Added a password."));
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(syncer::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.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
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