| Index: chrome/browser/chromeos/login/owner_key_utils_unittest.cc
|
| diff --git a/chrome/browser/chromeos/login/owner_key_utils_unittest.cc b/chrome/browser/chromeos/login/owner_key_utils_unittest.cc
|
| index 916b707b163ea5768737dbfa9d7bc50bd6b02c71..46db487237476e7aef08cfbb287314bdb2709c1c 100644
|
| --- a/chrome/browser/chromeos/login/owner_key_utils_unittest.cc
|
| +++ b/chrome/browser/chromeos/login/owner_key_utils_unittest.cc
|
| @@ -65,4 +65,20 @@ TEST_F(OwnerKeyUtilsTest, ExportImportPublicKey) {
|
| }
|
| }
|
|
|
| +TEST_F(OwnerKeyUtilsTest, ImportPublicKeyFailed) {
|
| + ScopedTempDir tmpdir;
|
| + FilePath tmpfile;
|
| + ASSERT_TRUE(tmpdir.CreateUniqueTempDir());
|
| +
|
| + // First test the case where the file is missing which should fail.
|
| + std::vector<uint8> from_disk;
|
| + ASSERT_FALSE(utils_->ImportPublicKey(tmpfile, &from_disk));
|
| +
|
| + // Next try empty file. This should fail and the array should be empty.
|
| + from_disk.resize(10);
|
| + ASSERT_TRUE(file_util::CreateTemporaryFileInDir(tmpdir.path(), &tmpfile));
|
| + ASSERT_FALSE(utils_->ImportPublicKey(tmpfile, &from_disk));
|
| + ASSERT_FALSE(from_disk.size());
|
| +}
|
| +
|
| } // namespace chromeos
|
|
|