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

Unified Diff: net/socket/socket_test_util.cc

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Added read/write socket error tests. Created 4 years, 11 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/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index f4b804bf4fb35698c65ac13ee3d4ca2c922e6133..f64b33bf2ed131076abc69a09cd67e9e9b22fa6d 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -36,6 +36,9 @@
namespace net {
+const NetworkChangeNotifier::NetworkHandle kDefaultNetworkForTests = 1;
+const NetworkChangeNotifier::NetworkHandle kNewNetworkForTests = 2;
+
namespace {
inline char AsciifyHigh(char x) {
@@ -1245,6 +1248,7 @@ MockUDPClientSocket::MockUDPClientSocket(SocketDataProvider* data,
read_data_(SYNCHRONOUS, ERR_UNEXPECTED),
need_read_data_(true),
source_port_(123),
+ network_(NetworkChangeNotifier::kInvalidNetworkHandle),
pending_read_buf_(NULL),
pending_read_buf_len_(0),
net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_NONE)),
@@ -1343,16 +1347,18 @@ const BoundNetLog& MockUDPClientSocket::NetLog() const {
int MockUDPClientSocket::BindToNetwork(
NetworkChangeNotifier::NetworkHandle network) {
- return ERR_NOT_IMPLEMENTED;
+ network_ = network;
+ return OK;
}
int MockUDPClientSocket::BindToDefaultNetwork() {
- return ERR_NOT_IMPLEMENTED;
+ network_ = kDefaultNetworkForTests;
+ return OK;
}
NetworkChangeNotifier::NetworkHandle MockUDPClientSocket::GetBoundNetwork()
const {
- return NetworkChangeNotifier::kInvalidNetworkHandle;
+ return network_;
}
int MockUDPClientSocket::Connect(const IPEndPoint& address) {

Powered by Google App Engine
This is Rietveld 408576698