| OLD | NEW |
| 1 // Copyright (c) 2010 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 "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" |
| 6 #include "chrome/test/live_sync/live_passwords_sync_test.h" | 8 #include "chrome/test/live_sync/live_passwords_sync_test.h" |
| 7 | 9 |
| 8 using webkit_glue::PasswordForm; | 10 using webkit_glue::PasswordForm; |
| 9 | 11 |
| 10 // TODO(rsimha): Enable once http://crbug.com/69604 is fixed. | 12 // TODO(rsimha): Enable once http://crbug.com/69604 is fixed. |
| 11 IN_PROC_BROWSER_TEST_F(ManyClientLivePasswordsSyncTest, DISABLED_Sanity) { | 13 IN_PROC_BROWSER_TEST_F(ManyClientLivePasswordsSyncTest, DISABLED_Sanity) { |
| 12 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 14 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| 13 | 15 |
| 14 PasswordForm form; | 16 PasswordForm form; |
| 15 form.origin = GURL("http://www.google.com/"); | 17 form.origin = GURL("http://www.google.com/"); |
| 16 form.username_value = ASCIIToUTF16("username"); | 18 form.username_value = ASCIIToUTF16("username"); |
| 17 form.password_value = ASCIIToUTF16("password"); | 19 form.password_value = ASCIIToUTF16("password"); |
| 18 | 20 |
| 19 AddLogin(GetVerifierPasswordStore(), form); | 21 AddLogin(GetVerifierPasswordStore(), form); |
| 20 AddLogin(GetPasswordStore(0), form); | 22 AddLogin(GetPasswordStore(0), form); |
| 21 | 23 |
| 22 ASSERT_TRUE(GetClient(0)->AwaitGroupSyncCycleCompletion(clients())); | 24 ASSERT_TRUE(GetClient(0)->AwaitGroupSyncCycleCompletion(clients())); |
| 23 | 25 |
| 24 std::vector<PasswordForm> expected; | 26 std::vector<PasswordForm> expected; |
| 25 GetLogins(GetVerifierPasswordStore(), form, expected); | 27 GetLogins(GetVerifierPasswordStore(), form, expected); |
| 26 ASSERT_EQ(1U, expected.size()); | 28 ASSERT_EQ(1U, expected.size()); |
| 27 | 29 |
| 28 for (int i = 0; i < num_clients(); ++i) { | 30 for (int i = 0; i < num_clients(); ++i) { |
| 29 std::vector<PasswordForm> actual; | 31 std::vector<PasswordForm> actual; |
| 30 GetLogins(GetPasswordStore(i), form, actual); | 32 GetLogins(GetPasswordStore(i), form, actual); |
| 31 | 33 |
| 32 ASSERT_TRUE(ContainsSamePasswordForms(expected, actual)); | 34 ASSERT_TRUE(ContainsSamePasswordForms(expected, actual)); |
| 33 } | 35 } |
| 34 } | 36 } |
| OLD | NEW |