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 "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h" | 5 #include "net/proxy/dhcp_proxy_script_adapter_fetcher_win.h" |
6 | 6 |
7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "base/timer/elapsed_timer.h" | 10 #include "base/timer/elapsed_timer.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 std::string ImplGetPacURLFromDhcp( | 73 std::string ImplGetPacURLFromDhcp( |
74 const std::string& adapter_name) override { | 74 const std::string& adapter_name) override { |
75 base::ElapsedTimer timer; | 75 base::ElapsedTimer timer; |
76 test_finished_event_.TimedWait(dhcp_delay_); | 76 test_finished_event_.TimedWait(dhcp_delay_); |
77 return configured_url_; | 77 return configured_url_; |
78 } | 78 } |
79 | 79 |
80 base::WaitableEvent test_finished_event_; | 80 base::WaitableEvent test_finished_event_; |
81 base::TimeDelta dhcp_delay_; | 81 base::TimeDelta dhcp_delay_; |
82 std::string configured_url_; | 82 std::string configured_url_; |
83 | |
84 private: | |
85 ~DelayingDhcpQuery() {} | |
Ryan Sleevi
2015/05/02 01:28:26
no "override" ?
| |
83 }; | 86 }; |
84 | 87 |
85 DhcpQuery* ImplCreateDhcpQuery() override { | 88 DhcpQuery* ImplCreateDhcpQuery() override { |
86 dhcp_query_ = new DelayingDhcpQuery(); | 89 dhcp_query_ = new DelayingDhcpQuery(); |
87 dhcp_query_->dhcp_delay_ = dhcp_delay_; | 90 dhcp_query_->dhcp_delay_ = dhcp_delay_; |
88 dhcp_query_->configured_url_ = configured_url_; | 91 dhcp_query_->configured_url_ = configured_url_; |
89 return dhcp_query_.get(); | 92 return dhcp_query_.get(); |
90 } | 93 } |
91 | 94 |
92 // Use a shorter timeout so tests can finish more quickly. | 95 // Use a shorter timeout so tests can finish more quickly. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 EXPECT_EQ(BASE_URL, | 330 EXPECT_EQ(BASE_URL, |
328 DhcpProxyScriptAdapterFetcher::SanitizeDhcpApiString( | 331 DhcpProxyScriptAdapterFetcher::SanitizeDhcpApiString( |
329 BASE_URL "\0foo\0blat", kBaseUrlLen + 9)); | 332 BASE_URL "\0foo\0blat", kBaseUrlLen + 9)); |
330 } | 333 } |
331 | 334 |
332 #undef BASE_URL | 335 #undef BASE_URL |
333 | 336 |
334 } // namespace | 337 } // namespace |
335 | 338 |
336 } // namespace net | 339 } // namespace net |
OLD | NEW |