OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/safe_browsing/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 private: | 95 private: |
96 MockSafeBrowsingDatabaseManager* mock_database_manager_; | 96 MockSafeBrowsingDatabaseManager* mock_database_manager_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService); | 98 DISALLOW_COPY_AND_ASSIGN(FakeSafeBrowsingService); |
99 }; | 99 }; |
100 | 100 |
101 class MockBinaryFeatureExtractor : public BinaryFeatureExtractor { | 101 class MockBinaryFeatureExtractor : public BinaryFeatureExtractor { |
102 public: | 102 public: |
103 MockBinaryFeatureExtractor() {} | 103 MockBinaryFeatureExtractor() {} |
104 MOCK_METHOD2(CheckSignature, void (const base::FilePath&, | 104 MOCK_METHOD2(CheckSignature, void(const base::FilePath&, |
105 ClientDownloadRequest_SignatureInfo*)); | 105 ClientDownloadRequest_SignatureInfo*)); |
106 MOCK_METHOD2(ExtractImageHeaders, void (const base::FilePath&, | 106 MOCK_METHOD2(ExtractImageHeaders, void(const base::FilePath&, |
107 ClientDownloadRequest_ImageHeaders*)); | 107 ClientDownloadRequest_ImageHeaders*)); |
108 | 108 |
109 protected: | 109 protected: |
110 virtual ~MockBinaryFeatureExtractor() {} | 110 virtual ~MockBinaryFeatureExtractor() {} |
111 | 111 |
112 private: | 112 private: |
113 DISALLOW_COPY_AND_ASSIGN(MockBinaryFeatureExtractor); | 113 DISALLOW_COPY_AND_ASSIGN(MockBinaryFeatureExtractor); |
114 }; | 114 }; |
115 | 115 |
116 class TestURLFetcherWatcher : public net::TestURLFetcherDelegateForTests { | 116 class TestURLFetcherWatcher : public net::TestURLFetcherDelegateForTests { |
117 public: | 117 public: |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 EXPECT_THAT(whitelist_strings, ElementsAre(cert_base + "/OU=unit")); | 1477 EXPECT_THAT(whitelist_strings, ElementsAre(cert_base + "/OU=unit")); |
1478 | 1478 |
1479 cert = ReadTestCertificate("test_c.pem"); | 1479 cert = ReadTestCertificate("test_c.pem"); |
1480 ASSERT_TRUE(cert.get()); | 1480 ASSERT_TRUE(cert.get()); |
1481 whitelist_strings.clear(); | 1481 whitelist_strings.clear(); |
1482 GetCertificateWhitelistStrings( | 1482 GetCertificateWhitelistStrings( |
1483 *cert.get(), *issuer_cert.get(), &whitelist_strings); | 1483 *cert.get(), *issuer_cert.get(), &whitelist_strings); |
1484 EXPECT_THAT(whitelist_strings, ElementsAre()); | 1484 EXPECT_THAT(whitelist_strings, ElementsAre()); |
1485 } | 1485 } |
1486 } // namespace safe_browsing | 1486 } // namespace safe_browsing |
OLD | NEW |