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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/signature_util_win.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« 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