| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/safe_browsing/signature_util.h" | |
| 6 | |
| 7 #include "base/base_paths.h" | |
| 8 #include "base/file_path.h" | |
| 9 #include "base/path_service.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | |
| 11 | |
| 12 namespace safe_browsing { | |
| 13 | |
| 14 TEST(SignatureUtilWinTest, IsSigned) { | |
| 15 FilePath source_path; | |
| 16 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &source_path)); | |
| 17 | |
| 18 FilePath testdata_path = source_path | |
| 19 .AppendASCII("chrome") | |
| 20 .AppendASCII("test") | |
| 21 .AppendASCII("data") | |
| 22 .AppendASCII("safe_browsing") | |
| 23 .AppendASCII("download_protection"); | |
| 24 | |
| 25 EXPECT_TRUE(signature_util::IsSigned(testdata_path.Append(L"signed.exe"))); | |
| 26 EXPECT_FALSE(signature_util::IsSigned( | |
| 27 testdata_path.Append(L"unsigned.exe"))); | |
| 28 EXPECT_FALSE(signature_util::IsSigned( | |
| 29 testdata_path.Append(L"doesnotexist.exe"))); | |
| 30 } | |
| 31 | |
| 32 } // namespace safe_browsing | |
| OLD | NEW |