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 #ifndef COMPONENTS_CERTIFICATE_TRANSPARENCY_MOCK_LOG_DNS_TRAFFIC_H_ | 5 #ifndef COMPONENTS_CERTIFICATE_TRANSPARENCY_MOCK_LOG_DNS_TRAFFIC_H_ |
6 #define COMPONENTS_CERTIFICATE_TRANSPARENCY_MOCK_LOG_DNS_TRAFFIC_H_ | 6 #define COMPONENTS_CERTIFICATE_TRANSPARENCY_MOCK_LOG_DNS_TRAFFIC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 // |net_error| can be any net:Error value. | 90 // |net_error| can be any net:Error value. |
91 void ExpectRequestAndSocketError(base::StringPiece qname, int net_error); | 91 void ExpectRequestAndSocketError(base::StringPiece qname, int net_error); |
92 // Expect a CT DNS request for the domain |qname|. | 92 // Expect a CT DNS request for the domain |qname|. |
93 // Such a request will timeout. | 93 // Such a request will timeout. |
94 // This will reduce the DNS timeout to minimize test duration. | 94 // This will reduce the DNS timeout to minimize test duration. |
95 void ExpectRequestAndTimeout(base::StringPiece qname); | 95 void ExpectRequestAndTimeout(base::StringPiece qname); |
96 // Expect a CT DNS request for the domain |qname|. | 96 // Expect a CT DNS request for the domain |qname|. |
97 // Such a request will receive a DNS response containing |leaf_index|. | 97 // Such a request will receive a DNS response containing |leaf_index|. |
98 // A description of such a request and response can be seen here: | 98 // A description of such a request and response can be seen here: |
99 // https://github.com/google/certificate-transparency-rfcs/blob/c8844de6bd0b5d 3d16bac79865e6edef533d760b/dns/draft-ct-over-dns.md#hash-query-hashquery | 99 // https://github.com/google/certificate-transparency-rfcs/blob/c8844de6bd0b5d 3d16bac79865e6edef533d760b/dns/draft-ct-over-dns.md#hash-query-hashquery |
100 void ExpectLeafIndexRequestAndResponse(base::StringPiece qname, | 100 void ExpectLeafIndexRequestAndResponse(base::StringPiece qname, |
Eran Messeri
2016/09/23 12:59:32
Given the method you've added I suggest removing t
Rob Percival
2016/09/27 17:44:17
I hadn't actually meant to add this one - I was ju
| |
101 base::StringPiece leaf_index); | 101 base::StringPiece leaf_index); |
102 // Expect a CT DNS request for the domain |qname|. | 102 // Expect a CT DNS request for the domain |qname|. |
103 // Such a request will receive a DNS response containing |leaf_index| as a | |
104 // string. | |
105 void ExpectLeafIndexRequestAndResponse(base::StringPiece qname, | |
106 uint64_t leaf_index); | |
107 // Expect a CT DNS request for the domain |qname|. | |
103 // Such a request will receive a DNS response containing the inclusion proof | 108 // Such a request will receive a DNS response containing the inclusion proof |
104 // nodes between |audit_path_start| and |audit_path_end|. | 109 // nodes between |audit_path_start| and |audit_path_end|. |
105 // A description of such a request and response can be seen here: | 110 // A description of such a request and response can be seen here: |
106 // https://github.com/google/certificate-transparency-rfcs/blob/c8844de6bd0b5d 3d16bac79865e6edef533d760b/dns/draft-ct-over-dns.md#tree-query-treequery | 111 // https://github.com/google/certificate-transparency-rfcs/blob/c8844de6bd0b5d 3d16bac79865e6edef533d760b/dns/draft-ct-over-dns.md#tree-query-treequery |
107 void ExpectAuditProofRequestAndResponse( | 112 void ExpectAuditProofRequestAndResponse( |
108 base::StringPiece qname, | 113 base::StringPiece qname, |
109 std::vector<std::string>::const_iterator audit_path_start, | 114 std::vector<std::string>::const_iterator audit_path_start, |
110 std::vector<std::string>::const_iterator audit_path_end); | 115 std::vector<std::string>::const_iterator audit_path_end); |
111 | 116 |
112 // Sets the initial DNS config appropriate for testing. | 117 // Sets the initial DNS config appropriate for testing. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 net::MockClientSocketFactory socket_factory_; | 158 net::MockClientSocketFactory socket_factory_; |
154 // Controls whether mock socket reads are asynchronous. | 159 // Controls whether mock socket reads are asynchronous. |
155 net::IoMode socket_read_mode_; | 160 net::IoMode socket_read_mode_; |
156 | 161 |
157 DISALLOW_COPY_AND_ASSIGN(MockLogDnsTraffic); | 162 DISALLOW_COPY_AND_ASSIGN(MockLogDnsTraffic); |
158 }; | 163 }; |
159 | 164 |
160 } // namespace certificate_transparency | 165 } // namespace certificate_transparency |
161 | 166 |
162 #endif // COMPONENTS_CERTIFICATE_TRANSPARENCY_MOCK_LOG_DNS_TRAFFIC_H_ | 167 #endif // COMPONENTS_CERTIFICATE_TRANSPARENCY_MOCK_LOG_DNS_TRAFFIC_H_ |
OLD | NEW |