| OLD | NEW |
| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/guid.h" | 9 #include "base/guid.h" |
| 10 #include "base/hash.h" | 10 #include "base/hash.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 using passwords_helper::AllProfilesContainSamePasswordFormsAsVerifier; | 24 using passwords_helper::AllProfilesContainSamePasswordFormsAsVerifier; |
| 25 using passwords_helper::AwaitAllProfilesContainSamePasswordForms; | 25 using passwords_helper::AwaitAllProfilesContainSamePasswordForms; |
| 26 using passwords_helper::AwaitProfileContainsSamePasswordFormsAsVerifier; | 26 using passwords_helper::AwaitProfileContainsSamePasswordFormsAsVerifier; |
| 27 using passwords_helper::CreateTestPasswordForm; | 27 using passwords_helper::CreateTestPasswordForm; |
| 28 using passwords_helper::GetPasswordCount; | 28 using passwords_helper::GetPasswordCount; |
| 29 using passwords_helper::GetPasswordStore; | 29 using passwords_helper::GetPasswordStore; |
| 30 using passwords_helper::GetVerifierPasswordCount; | 30 using passwords_helper::GetVerifierPasswordCount; |
| 31 using passwords_helper::GetVerifierPasswordStore; | 31 using passwords_helper::GetVerifierPasswordStore; |
| 32 using passwords_helper::RemoveLogin; | 32 using passwords_helper::RemoveLogin; |
| 33 using passwords_helper::RemoveLogins; | 33 using passwords_helper::RemoveLogins; |
| 34 using passwords_helper::SetDecryptionPassphrase; | |
| 35 using passwords_helper::SetEncryptionPassphrase; | |
| 36 using passwords_helper::UpdateLogin; | 34 using passwords_helper::UpdateLogin; |
| 37 using sync_integration_test_util::AwaitPassphraseAccepted; | 35 using sync_integration_test_util::AwaitPassphraseAccepted; |
| 38 using sync_integration_test_util::AwaitPassphraseRequired; | 36 using sync_integration_test_util::AwaitPassphraseRequired; |
| 39 | 37 |
| 40 using autofill::PasswordForm; | 38 using autofill::PasswordForm; |
| 41 | 39 |
| 42 static const char* kValidPassphrase = "passphrase!"; | 40 static const char* kValidPassphrase = "passphrase!"; |
| 43 | 41 |
| 44 class TwoClientPasswordsSyncTest : public SyncTest { | 42 class TwoClientPasswordsSyncTest : public SyncTest { |
| 45 public: | 43 public: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 76 |
| 79 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); | 77 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); |
| 80 } | 78 } |
| 81 | 79 |
| 82 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, | 80 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, |
| 83 E2E_ENABLED(SetPassphraseAndAddPassword)) { | 81 E2E_ENABLED(SetPassphraseAndAddPassword)) { |
| 84 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 82 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 85 | 83 |
| 86 SetEncryptionPassphrase(0, kValidPassphrase, | 84 SetEncryptionPassphrase(0, kValidPassphrase, |
| 87 browser_sync::ProfileSyncService::EXPLICIT); | 85 browser_sync::ProfileSyncService::EXPLICIT); |
| 88 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService((0)))); | 86 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(0))); |
| 89 | 87 |
| 90 ASSERT_TRUE(AwaitPassphraseRequired(GetSyncService((1)))); | 88 ASSERT_TRUE(AwaitPassphraseRequired(GetSyncService(1))); |
| 91 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); | 89 ASSERT_TRUE(SetDecryptionPassphrase(1, kValidPassphrase)); |
| 92 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService((1)))); | 90 ASSERT_TRUE(AwaitPassphraseAccepted(GetSyncService(1))); |
| 93 | 91 |
| 94 PasswordForm form = CreateTestPasswordForm(0); | 92 PasswordForm form = CreateTestPasswordForm(0); |
| 95 AddLogin(GetPasswordStore(0), form); | 93 AddLogin(GetPasswordStore(0), form); |
| 96 ASSERT_EQ(1, GetPasswordCount(0)); | 94 ASSERT_EQ(1, GetPasswordCount(0)); |
| 97 | 95 |
| 98 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); | 96 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); |
| 99 } | 97 } |
| 100 | 98 |
| 101 // TCM ID - 4603879 | 99 // TCM ID - 4603879 |
| 102 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Update) { | 100 IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, Update) { |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 258 |
| 261 // Blocks and waits for password forms in all profiles to match. | 259 // Blocks and waits for password forms in all profiles to match. |
| 262 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); | 260 ASSERT_TRUE(AwaitAllProfilesContainSamePasswordForms()); |
| 263 | 261 |
| 264 // Check that total number of passwords is as expected. | 262 // Check that total number of passwords is as expected. |
| 265 for (int i = 0; i < num_clients(); ++i) { | 263 for (int i = 0; i < num_clients(); ++i) { |
| 266 ASSERT_EQ(GetPasswordCount(i), init_password_count + num_clients()) << | 264 ASSERT_EQ(GetPasswordCount(i), init_password_count + num_clients()) << |
| 267 "Total password count is wrong."; | 265 "Total password count is wrong."; |
| 268 } | 266 } |
| 269 } | 267 } |
| OLD | NEW |