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

Unified Diff: net/socket/client_socket_pool_base_unittest.cc

Issue 176024: Make GetLoadState virtual in ConnectJob(). (Closed)
Patch Set: Created 11 years, 4 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/socket/client_socket_pool_base.cc ('k') | net/socket/tcp_client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base_unittest.cc
diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc
index fff686957972f739011d3701fab86a268bf0126b..52f280204cad6902c5c75bb09a16c9a18227ce8f 100644
--- a/net/socket/client_socket_pool_base_unittest.cc
+++ b/net/socket/client_socket_pool_base_unittest.cc
@@ -118,12 +118,15 @@ class TestConnectJob : public ConnectJob {
delegate, load_log),
job_type_(job_type),
client_socket_factory_(client_socket_factory),
- method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {}
+ method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ load_state_(LOAD_STATE_IDLE) {}
void Signal() {
DoConnect(waiting_success_, true /* async */);
}
+ virtual LoadState GetLoadState() const { return load_state_; }
+
private:
// ConnectJob methods:
@@ -162,7 +165,7 @@ class TestConnectJob : public ConnectJob {
MessageLoop::current()->PostTask(
FROM_HERE,
method_factory_.NewRunnableMethod(
- &TestConnectJob::AdvanceLoadState, load_state()));
+ &TestConnectJob::AdvanceLoadState, load_state_));
return ERR_IO_PENDING;
default:
NOTREACHED();
@@ -171,6 +174,8 @@ class TestConnectJob : public ConnectJob {
}
}
+ void set_load_state(LoadState load_state) { load_state_ = load_state; }
+
int DoConnect(bool succeed, bool was_async) {
int result = ERR_CONNECTION_FAILED;
if (succeed) {
@@ -202,6 +207,7 @@ class TestConnectJob : public ConnectJob {
const JobType job_type_;
MockClientSocketFactory* const client_socket_factory_;
ScopedRunnableMethodFactory<TestConnectJob> method_factory_;
+ LoadState load_state_;
DISALLOW_COPY_AND_ASSIGN(TestConnectJob);
};
« no previous file with comments | « net/socket/client_socket_pool_base.cc ('k') | net/socket/tcp_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698