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" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/scoped_temp_dir.h" | 19 #include "base/scoped_temp_dir.h" |
20 #include "base/string_number_conversions.h" | 20 #include "base/string_number_conversions.h" |
21 #include "base/threading/sequenced_worker_pool.h" | 21 #include "base/threading/sequenced_worker_pool.h" |
22 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 22 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
23 #include "chrome/browser/safe_browsing/signature_util.h" | 23 #include "chrome/browser/safe_browsing/signature_util.h" |
24 #include "chrome/common/safe_browsing/csd.pb.h" | 24 #include "chrome/common/safe_browsing/csd.pb.h" |
25 #include "chrome/common/zip.h" | 25 #include "chrome/common/zip.h" |
26 #include "content/public/browser/download_item.h" | 26 #include "content/public/browser/download_item.h" |
27 #include "content/test/test_browser_thread.h" | 27 #include "content/public/test/test_browser_thread.h" |
28 #include "content/test/test_url_fetcher_factory.h" | 28 #include "content/test/test_url_fetcher_factory.h" |
29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
30 #include "net/base/x509_certificate.h" | 30 #include "net/base/x509_certificate.h" |
31 #include "net/url_request/url_fetcher_delegate.h" | 31 #include "net/url_request/url_fetcher_delegate.h" |
32 #include "testing/gmock/include/gmock/gmock.h" | 32 #include "testing/gmock/include/gmock/gmock.h" |
33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
34 | 34 |
35 using ::testing::ContainerEq; | 35 using ::testing::ContainerEq; |
36 using ::testing::DoAll; | 36 using ::testing::DoAll; |
37 using ::testing::ElementsAre; | 37 using ::testing::ElementsAre; |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 GetCertificateWhitelistStrings(*cert, *issuer_cert, &whitelist_strings); | 848 GetCertificateWhitelistStrings(*cert, *issuer_cert, &whitelist_strings); |
849 EXPECT_THAT(whitelist_strings, ElementsAre(cert_base + "/OU=unit")); | 849 EXPECT_THAT(whitelist_strings, ElementsAre(cert_base + "/OU=unit")); |
850 | 850 |
851 cert = ReadTestCertificate("test_c.pem"); | 851 cert = ReadTestCertificate("test_c.pem"); |
852 ASSERT_TRUE(cert.get()); | 852 ASSERT_TRUE(cert.get()); |
853 whitelist_strings.clear(); | 853 whitelist_strings.clear(); |
854 GetCertificateWhitelistStrings(*cert, *issuer_cert, &whitelist_strings); | 854 GetCertificateWhitelistStrings(*cert, *issuer_cert, &whitelist_strings); |
855 EXPECT_THAT(whitelist_strings, ElementsAre()); | 855 EXPECT_THAT(whitelist_strings, ElementsAre()); |
856 } | 856 } |
857 } // namespace safe_browsing | 857 } // namespace safe_browsing |
OLD | NEW |