Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2648)

Unified Diff: chrome/browser/safe_browsing/signature_util_win_unittest.cc

Issue 8345033: Collect some histograms about signed binary downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix chromeos and valgrind Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/signature_util_win.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/signature_util_win_unittest.cc
diff --git a/chrome/browser/safe_browsing/signature_util_win_unittest.cc b/chrome/browser/safe_browsing/signature_util_win_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b3131fcb6ac47e6aebee458f6b7279dbfe4af2c2
--- /dev/null
+++ b/chrome/browser/safe_browsing/signature_util_win_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/safe_browsing/signature_util.h"
+
+#include "base/base_paths.h"
+#include "base/file_path.h"
+#include "base/path_service.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace safe_browsing {
+
+TEST(SignatureUtilWinTest, IsSigned) {
+ FilePath source_path;
+ ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &source_path));
+
+ FilePath testdata_path = source_path
+ .AppendASCII("chrome")
+ .AppendASCII("test")
+ .AppendASCII("data")
+ .AppendASCII("safe_browsing")
+ .AppendASCII("download_protection");
+
+ EXPECT_TRUE(signature_util::IsSigned(testdata_path.Append(L"signed.exe")));
+ EXPECT_FALSE(signature_util::IsSigned(
+ testdata_path.Append(L"unsigned.exe")));
+ EXPECT_FALSE(signature_util::IsSigned(
+ testdata_path.Append(L"doesnotexist.exe")));
+}
+
+} // namespace safe_browsing
« no previous file with comments | « chrome/browser/safe_browsing/signature_util_win.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698