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

Unified Diff: net/socket/tcp_client_socket_pool_unittest.cc

Issue 2802015: Massively simplify the NetworkChangeNotifier infrastructure:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
Index: net/socket/tcp_client_socket_pool_unittest.cc
===================================================================
--- net/socket/tcp_client_socket_pool_unittest.cc (revision 50775)
+++ net/socket/tcp_client_socket_pool_unittest.cc (working copy)
@@ -8,7 +8,6 @@
#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "net/base/mock_host_resolver.h"
-#include "net/base/mock_network_change_notifier.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/socket/client_socket.h"
@@ -272,7 +271,6 @@
histograms_,
host_resolver_,
&client_socket_factory_,
- &notifier_,
NULL)) {
}
@@ -285,7 +283,6 @@
scoped_refptr<ClientSocketPoolHistograms> histograms_;
scoped_refptr<MockHostResolver> host_resolver_;
MockClientSocketFactory client_socket_factory_;
- MockNetworkChangeNotifier notifier_;
scoped_refptr<TCPClientSocketPool> pool_;
};
@@ -684,7 +681,9 @@
EXPECT_EQ(1, pool_->IdleSocketCount());
// After an IP address change, we should have 0 idle sockets.
- notifier_.NotifyIPAddressChange();
+ NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
+ MessageLoop::current()->RunAllPending(); // Notification happens async.
+
EXPECT_EQ(0, pool_->IdleSocketCount());
}
@@ -742,13 +741,8 @@
EXPECT_EQ(0, pool_->IdleSocketCount());
handle.Reset();
- pool_ = new TCPClientSocketPool(kMaxSockets,
- kMaxSocketsPerGroup,
- histograms_,
- host_resolver_,
- &client_socket_factory_,
- NULL,
- NULL);
+ pool_ = new TCPClientSocketPool(kMaxSockets, kMaxSocketsPerGroup,
+ histograms_, host_resolver_, &client_socket_factory_, NULL);
}
}

Powered by Google App Engine
This is Rietveld 408576698