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

Unified Diff: net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc

Issue 8139028: Add WorkerPool::PostTaskAndReply and use in DHCP code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mark private Created 9 years, 2 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/proxy/dhcp_proxy_script_adapter_fetcher_win.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 b46bbadcf715b577d16eeaabe0e44d8d691e0640..57f02f5b0398d430c44e2a9aacba895da41aebf7 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
@@ -60,11 +60,10 @@ class MockDhcpProxyScriptAdapterFetcher
return fetcher_;
}
- class DelayingWorkerThread : public WorkerThread {
+ class DelayingDhcpQuery : public DhcpQuery {
public:
- explicit DelayingWorkerThread(
- const base::WeakPtr<DhcpProxyScriptAdapterFetcher>& owner)
- : WorkerThread(owner),
+ explicit DelayingDhcpQuery()
+ : DhcpQuery(),
test_finished_event_(true, false) {
}
@@ -80,12 +79,11 @@ class MockDhcpProxyScriptAdapterFetcher
std::string configured_url_;
};
- virtual WorkerThread* ImplCreateWorkerThread(
- const base::WeakPtr<DhcpProxyScriptAdapterFetcher>& owner) OVERRIDE {
- worker_thread_ = new DelayingWorkerThread(owner);
- worker_thread_->dhcp_delay_ = TimeDelta::FromMilliseconds(dhcp_delay_ms_);
- worker_thread_->configured_url_ = configured_url_;
- return worker_thread_;
+ virtual DhcpQuery* ImplCreateDhcpQuery() OVERRIDE {
+ dhcp_query_ = new DelayingDhcpQuery();
+ dhcp_query_->dhcp_delay_ = TimeDelta::FromMilliseconds(dhcp_delay_ms_);
+ dhcp_query_->configured_url_ = configured_url_;
+ return dhcp_query_;
}
// Use a shorter timeout so tests can finish more quickly.
@@ -115,8 +113,8 @@ class MockDhcpProxyScriptAdapterFetcher
}
void FinishTest() {
- DCHECK(worker_thread_);
- worker_thread_->test_finished_event_.Signal();
+ DCHECK(dhcp_query_);
+ dhcp_query_->test_finished_event_.Signal();
}
int dhcp_delay_ms_;
@@ -127,7 +125,7 @@ class MockDhcpProxyScriptAdapterFetcher
std::string pac_script_;
MockProxyScriptFetcher* fetcher_;
base::OneShotTimer<MockDhcpProxyScriptAdapterFetcher> fetcher_timer_;
- scoped_refptr<DelayingWorkerThread> worker_thread_;
+ scoped_refptr<DelayingDhcpQuery> dhcp_query_;
};
class FetcherClient {
« no previous file with comments | « net/proxy/dhcp_proxy_script_adapter_fetcher_win.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