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 "chrome/browser/password_manager/encryptor_password_mac.h" | 5 #include "components/webdata/encryptor/encryptor_password_mac.h" |
6 #include "crypto/mock_apple_keychain.h" | 6 #include "crypto/mock_apple_keychain.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
11 using crypto::MockAppleKeychain; | 11 using crypto::MockAppleKeychain; |
12 | 12 |
13 // Test that if we have an existing password in the Keychain and we are | 13 // Test that if we have an existing password in the Keychain and we are |
14 // authorized by the user to read it then we get it back correctly. | 14 // authorized by the user to read it then we get it back correctly. |
15 TEST(EncryptorPasswordTest, FindPasswordSuccess) { | 15 TEST(EncryptorPasswordTest, FindPasswordSuccess) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 std::string password2 = encryptor_password2.GetEncryptorPassword(); | 70 std::string password2 = encryptor_password2.GetEncryptorPassword(); |
71 EXPECT_FALSE(password2.empty()); | 71 EXPECT_FALSE(password2.empty()); |
72 EXPECT_TRUE(keychain2.called_add_generic()); | 72 EXPECT_TRUE(keychain2.called_add_generic()); |
73 EXPECT_EQ(0, keychain2.password_data_count()); | 73 EXPECT_EQ(0, keychain2.password_data_count()); |
74 | 74 |
75 // And finally check that the passwords are different. | 75 // And finally check that the passwords are different. |
76 EXPECT_NE(password1, password2); | 76 EXPECT_NE(password1, password2); |
77 } | 77 } |
78 | 78 |
79 } // namespace | 79 } // namespace |
OLD | NEW |