Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc

Issue 10692155: Switch to TimeDelta interfaces for process waiting functions in net and ipc. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
index 0c612eb2ab3183a060be3786c6091847791f1e28..2e9bd4cef4ed02959190afb8e76160842747eaa1 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
@@ -35,8 +35,8 @@ class MockDhcpProxyScriptAdapterFetcher
public:
explicit MockDhcpProxyScriptAdapterFetcher(URLRequestContext* context)
: DhcpProxyScriptAdapterFetcher(context),
- dhcp_delay_ms_(1),
- timeout_ms_(TestTimeouts::action_timeout_ms()),
+ dhcp_delay_(base::TimeDelta::FromMilliseconds(1)),
+ timeout_(TestTimeouts::action_timeout()),
configured_url_(kPacUrl),
fetcher_delay_ms_(1),
fetcher_result_(OK),
@@ -75,20 +75,20 @@ class MockDhcpProxyScriptAdapterFetcher
}
base::WaitableEvent test_finished_event_;
- TimeDelta dhcp_delay_;
+ base::TimeDelta dhcp_delay_;
std::string configured_url_;
};
virtual DhcpQuery* ImplCreateDhcpQuery() OVERRIDE {
dhcp_query_ = new DelayingDhcpQuery();
- dhcp_query_->dhcp_delay_ = TimeDelta::FromMilliseconds(dhcp_delay_ms_);
+ dhcp_query_->dhcp_delay_ = dhcp_delay_;
dhcp_query_->configured_url_ = configured_url_;
return dhcp_query_;
}
// Use a shorter timeout so tests can finish more quickly.
virtual base::TimeDelta ImplGetTimeout() const OVERRIDE {
- return base::TimeDelta::FromMilliseconds(timeout_ms_);
+ return timeout_;
}
void OnFetcherTimer() {
@@ -117,8 +117,8 @@ class MockDhcpProxyScriptAdapterFetcher
dhcp_query_->test_finished_event_.Signal();
}
- int dhcp_delay_ms_;
- int timeout_ms_;
+ base::TimeDelta dhcp_delay_;
+ base::TimeDelta timeout_;
std::string configured_url_;
int fetcher_delay_ms_;
int fetcher_result_;
@@ -183,8 +183,8 @@ TEST(DhcpProxyScriptAdapterFetcher, TimeoutDuringDhcp) {
// present on the network) accessing DHCP can take on the order of tens
// of seconds.
FetcherClient client;
- client.fetcher_->dhcp_delay_ms_ = TestTimeouts::action_max_timeout_ms();
- client.fetcher_->timeout_ms_ = 25;
+ client.fetcher_->dhcp_delay_ = TestTimeouts::action_max_timeout();
+ client.fetcher_->timeout_ = base::TimeDelta::FromMilliseconds(25);
PerfTimer timer;
client.RunTest();
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | net/proxy/dhcp_proxy_script_fetcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698