| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/certificate_transparency/log_dns_client.h" | 5 #include "components/certificate_transparency/log_dns_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 void WaitUntilRun() { run_loop_.Run(); } | 106 void WaitUntilRun() { run_loop_.Run(); } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 bool called_; | 109 bool called_; |
| 110 int net_error_; | 110 int net_error_; |
| 111 std::unique_ptr<net::ct::MerkleAuditProof> proof_; | 111 std::unique_ptr<net::ct::MerkleAuditProof> proof_; |
| 112 base::RunLoop run_loop_; | 112 base::RunLoop run_loop_; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace |
| 116 |
| 115 class LogDnsClientTest : public ::testing::TestWithParam<net::IoMode> { | 117 class LogDnsClientTest : public ::testing::TestWithParam<net::IoMode> { |
| 116 protected: | 118 protected: |
| 117 LogDnsClientTest() | 119 LogDnsClientTest() |
| 118 : network_change_notifier_(net::NetworkChangeNotifier::CreateMock()) { | 120 : network_change_notifier_(net::NetworkChangeNotifier::CreateMock()) { |
| 119 mock_dns_.SetSocketReadMode(GetParam()); | 121 mock_dns_.SetSocketReadMode(GetParam()); |
| 120 mock_dns_.InitializeDnsConfig(); | 122 mock_dns_.InitializeDnsConfig(); |
| 121 } | 123 } |
| 122 | 124 |
| 123 void QueryLeafIndex(base::StringPiece log_domain, | 125 void QueryLeafIndex(base::StringPiece log_domain, |
| 124 base::StringPiece leaf_hash, | 126 base::StringPiece leaf_hash, |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // Let the DNS config change propogate. | 545 // Let the DNS config change propogate. |
| 544 base::RunLoop().RunUntilIdle(); | 546 base::RunLoop().RunUntilIdle(); |
| 545 EXPECT_THAT(dns_client->GetConfig()->nameservers, Not(IsEmpty())); | 547 EXPECT_THAT(dns_client->GetConfig()->nameservers, Not(IsEmpty())); |
| 546 } | 548 } |
| 547 | 549 |
| 548 INSTANTIATE_TEST_CASE_P(ReadMode, | 550 INSTANTIATE_TEST_CASE_P(ReadMode, |
| 549 LogDnsClientTest, | 551 LogDnsClientTest, |
| 550 ::testing::Values(net::IoMode::ASYNC, | 552 ::testing::Values(net::IoMode::ASYNC, |
| 551 net::IoMode::SYNCHRONOUS)); | 553 net::IoMode::SYNCHRONOUS)); |
| 552 | 554 |
| 553 } // namespace | |
| 554 } // namespace certificate_transparency | 555 } // namespace certificate_transparency |
| OLD | NEW |