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