Chromium Code Reviews| 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..ebd053d513db97a0e81abb4ef3324b3f6d3651f0 100644 |
| --- a/chrome/browser/chromeos/login/owner_key_utils_unittest.cc |
| +++ b/chrome/browser/chromeos/login/owner_key_utils_unittest.cc |
| @@ -65,4 +65,23 @@ 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 not fail but the array should be empty. |
| + from_disk.resize(10); |
| + ASSERT_TRUE(file_util::CreateTemporaryFileInDir(tmpdir.path(), &tmpfile)); |
| + ASSERT_TRUE(utils_->ImportPublicKey(tmpfile, &from_disk)); |
| + ASSERT_FALSE(from_disk.size()); |
| + |
| + // TODO(pastarmovj): Do we want to have a test for the <4GB boundary? This |
| + // will require quite some free space on the test bots. |
|
Mattias Nissler (ping if slow)
2012/05/21 14:33:27
No. And this shouldn't be a TODO probably. If you
pastarmovj
2012/05/21 14:38:23
Done.
|
| +} |
| + |
| } // namespace chromeos |