| OLD | NEW |
| 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/password_manager/password_form_data.h" | 6 #include "chrome/browser/password_manager/password_form_data.h" |
| 7 #include "chrome/browser/sync/profile_sync_service_harness.h" | 7 #include "chrome/browser/sync/profile_sync_service_harness.h" |
| 8 #include "chrome/browser/sync/sessions/session_state.h" | 8 #include "chrome/browser/sync/sessions/session_state.h" |
| 9 #include "chrome/test/live_sync/live_passwords_sync_test.h" | 9 #include "chrome/test/live_sync/live_passwords_sync_test.h" |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 GetLogins(GetPasswordStore(0), forms0); | 88 GetLogins(GetPasswordStore(0), forms0); |
| 89 ASSERT_EQ(1U, forms0.size()); | 89 ASSERT_EQ(1U, forms0.size()); |
| 90 | 90 |
| 91 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 91 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 92 | 92 |
| 93 std::vector<PasswordForm> forms1; | 93 std::vector<PasswordForm> forms1; |
| 94 GetLogins(GetPasswordStore(1), forms1); | 94 GetLogins(GetPasswordStore(1), forms1); |
| 95 ASSERT_EQ(1U, forms1.size()); | 95 ASSERT_EQ(1U, forms1.size()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // TODO(rsimha): Marked as flaky due to crbug.com/81341. | |
| 99 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest, | 98 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest, |
| 100 FLAKY_SetPassphraseAndThenSetupSync) { | 99 SetPassphraseAndThenSetupSync) { |
| 101 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; | 100 ASSERT_TRUE(SetupClients()) << "SetupClients() failed."; |
| 102 | 101 |
| 103 ASSERT_TRUE(GetClient(0)->SetupSync()); | 102 ASSERT_TRUE(GetClient(0)->SetupSync()); |
| 104 SetPassphrase(0, kValidPassphrase, true); | 103 SetPassphrase(0, kValidPassphrase, true); |
| 105 ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); | 104 ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); |
| 106 ASSERT_TRUE(GetClient(0)->AwaitSyncCycleCompletion("Initial sync.")); | 105 ASSERT_TRUE(GetClient(0)->AwaitSyncCycleCompletion("Initial sync.")); |
| 107 | 106 |
| 108 ASSERT_FALSE(GetClient(1)->SetupSync()); | 107 ASSERT_FALSE(GetClient(1)->SetupSync()); |
| 109 SetPassphrase(1, kValidPassphrase, false); | 108 SetPassphrase(1, kValidPassphrase, false); |
| 110 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); | 109 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); |
| 111 ASSERT_TRUE(GetClient(1)->AwaitSyncCycleCompletion("Initial sync.")); | 110 ASSERT_TRUE(GetClient(1)->AwaitSyncCycleCompletion("Initial sync.")); |
| 112 } | 111 } |
| 113 | 112 |
| 114 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest, | 113 IN_PROC_BROWSER_TEST_F(TwoClientLivePasswordsSyncTest, |
| 115 SetPassphraseTwice) { | 114 SetPassphraseTwice) { |
| 116 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 115 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 117 | 116 |
| 118 SetPassphrase(0, kValidPassphrase, true); | 117 SetPassphrase(0, kValidPassphrase, true); |
| 119 ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); | 118 ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); |
| 120 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); | 119 ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); |
| 121 | 120 |
| 122 SetPassphrase(1, kValidPassphrase, false); | 121 SetPassphrase(1, kValidPassphrase, false); |
| 123 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); | 122 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); |
| 124 ASSERT_TRUE(GetClient(1)->AwaitSyncCycleCompletion("Set passphrase.")); | 123 ASSERT_TRUE(GetClient(1)->AwaitSyncCycleCompletion("Set passphrase.")); |
| 125 | 124 |
| 126 SetPassphrase(1, kValidPassphrase, false); | 125 SetPassphrase(1, kValidPassphrase, false); |
| 127 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); | 126 ASSERT_TRUE(GetClient(1)->AwaitPassphraseAccepted()); |
| 128 ASSERT_TRUE(GetClient(1)->AwaitSyncCycleCompletion("Set passphrase again.")); | 127 ASSERT_TRUE(GetClient(1)->AwaitSyncCycleCompletion("Set passphrase again.")); |
| 129 } | 128 } |
| OLD | NEW |