| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "net/cert/cert_verify_proc_whitelist.h" | 5 #include "net/cert/cert_verify_proc_whitelist.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "net/cert/x509_certificate.h" | 8 #include "net/cert/x509_certificate.h" |
| 9 #include "net/test/cert_test_util.h" | 9 #include "net/test/cert_test_util.h" |
| 10 #include "net/test/test_data_directory.h" | 10 #include "net/test/test_data_directory.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 namespace test1 { | 17 namespace test1 { |
| 18 #include "net/cert/cert_verify_proc_whitelist_unittest1-inc.cc" | 18 #include "net/cert/cert_verify_proc_whitelist_unittest1-inc.cc" |
| 19 } // namespace test | 19 } // namespace test1 |
| 20 | 20 |
| 21 TEST(CertVerifyProcWhitelistTest, HandlesWosignCerts) { | 21 TEST(CertVerifyProcWhitelistTest, HandlesWosignCerts) { |
| 22 // The domain must be in the whitelist from | 22 // The domain must be in the whitelist from |
| 23 // //net/data/ssl/wosign/wosign_domains.gperf | 23 // //net/data/ssl/wosign/wosign_domains.gperf |
| 24 const char kWhitelistedDomain[] = "005.tv"; | 24 const char kWhitelistedDomain[] = "005.tv"; |
| 25 const char kNonWhitelistedDomain[] = "006.tv"; | 25 const char kNonWhitelistedDomain[] = "006.tv"; |
| 26 | 26 |
| 27 scoped_refptr<X509Certificate> cert = | 27 scoped_refptr<X509Certificate> cert = |
| 28 ImportCertFromFile(GetTestCertsDirectory(), "wosign_before_oct_21.pem"); | 28 ImportCertFromFile(GetTestCertsDirectory(), "wosign_before_oct_21.pem"); |
| 29 ASSERT_TRUE(cert); | 29 ASSERT_TRUE(cert); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // in the graph. | 94 // in the graph. |
| 95 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "domain.com")); | 95 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "domain.com")); |
| 96 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "example..com")); | 96 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "example..com")); |
| 97 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "www.co.uk")); | 97 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "www.co.uk")); |
| 98 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "www..co.uk")); | 98 EXPECT_FALSE(IsWhitelistedHost(graph, graph_size, "www..co.uk")); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace | 101 } // namespace |
| 102 | 102 |
| 103 } // namespace net | 103 } // namespace net |
| OLD | NEW |