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

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: More tests added and some fixes. Created 5 years 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 96515c33779d6fb692bd249714aea857d6229d00..65ce17e08952418299daf65e14b958c7c1c5098e 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -35,6 +35,9 @@
namespace net {
+NET_EXPORT NetworkChangeNotifier::NetworkHandle kDefaultNetworkForTests = 1;
+NET_EXPORT NetworkChangeNotifier::NetworkHandle kNewNetworkForTests = 2;
Ryan Hamilton 2015/12/29 05:29:36 Is this used?
Jana 2016/01/06 23:01:17 It's used in the tests, but I declared it here wit
+
namespace {
inline char AsciifyHigh(char x) {
@@ -1243,6 +1246,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)),
@@ -1341,16 +1345,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