| 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 #ifndef NET_DNS_DNS_TEST_UTIL_H_ | 5 #ifndef NET_DNS_DNS_TEST_UTIL_H_ |
| 6 #define NET_DNS_DNS_TEST_UTIL_H_ | 6 #define NET_DNS_DNS_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 class MockDnsClient : public DnsClient { | 188 class MockDnsClient : public DnsClient { |
| 189 public: | 189 public: |
| 190 MockDnsClient(const DnsConfig& config, const MockDnsClientRuleList& rules); | 190 MockDnsClient(const DnsConfig& config, const MockDnsClientRuleList& rules); |
| 191 ~MockDnsClient() override; | 191 ~MockDnsClient() override; |
| 192 | 192 |
| 193 // DnsClient interface: | 193 // DnsClient interface: |
| 194 void SetConfig(const DnsConfig& config) override; | 194 void SetConfig(const DnsConfig& config) override; |
| 195 const DnsConfig* GetConfig() const override; | 195 const DnsConfig* GetConfig() const override; |
| 196 DnsTransactionFactory* GetTransactionFactory() override; | 196 DnsTransactionFactory* GetTransactionFactory() override; |
| 197 AddressSorter* GetAddressSorter() override; | 197 AddressSorter* GetAddressSorter() override; |
| 198 void ApplyPersistentData(const base::Value& data) override; |
| 199 std::unique_ptr<const base::Value> GetPersistentData() const override; |
| 198 | 200 |
| 199 // Completes all DnsTransactions that were delayed by a rule. | 201 // Completes all DnsTransactions that were delayed by a rule. |
| 200 void CompleteDelayedTransactions(); | 202 void CompleteDelayedTransactions(); |
| 201 | 203 |
| 202 private: | 204 private: |
| 203 DnsConfig config_; | 205 DnsConfig config_; |
| 204 std::unique_ptr<MockTransactionFactory> factory_; | 206 std::unique_ptr<MockTransactionFactory> factory_; |
| 205 std::unique_ptr<AddressSorter> address_sorter_; | 207 std::unique_ptr<AddressSorter> address_sorter_; |
| 206 }; | 208 }; |
| 207 | 209 |
| 208 } // namespace net | 210 } // namespace net |
| 209 | 211 |
| 210 #endif // NET_DNS_DNS_TEST_UTIL_H_ | 212 #endif // NET_DNS_DNS_TEST_UTIL_H_ |
| OLD | NEW |