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

Unified Diff: net/test/embedded_test_server/embedded_test_server.cc

Issue 418043002: Add test for showing confirmation dialog for unsecure signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix EmbeddedTestServer on windows Created 6 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 | « google_apis/gaia/fake_gaia.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/embedded_test_server.cc
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 75b46e22166e6fb8aaaccddaf74e46dd863f3072..a0243eef40a1186bd5555d4159050ea4bf147e77 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -198,6 +198,24 @@ void EmbeddedTestServer::InitializeOnIOThread() {
void EmbeddedTestServer::ListenOnIOThread() {
DCHECK(io_thread_->message_loop_proxy()->BelongsToCurrentThread());
DCHECK(Started());
+
+#if !defined(OS_POSIX)
+ // Releases the socket here so that we could rebind it and watch it on the
+ // right IO thread below. An alternative is to simply call
+ // StreamListenSocket::WatchSocket, which is protected at the moment.
+ // This hack is only needed for non POSIX platforms, since on POSIX platforms
+ // StreamListenSocket::Listen calls StreamListenSocket::WatchSocket inside the
+ // function.
+ listen_socket_.reset();
+
+ SocketDescriptor socket_descriptor =
+ TCPListenSocket::CreateAndBind("127.0.0.1", port_);
xiyuan 2014/08/11 22:00:41 Thank you for digging through the problem. Maybe
oshima 2014/08/12 04:27:25 sounds good to me. If this was broken, I'm curiou
guohui 2014/08/12 15:55:19 thanks xiyuan, missed that =) i think it is becau
+ if (socket_descriptor == kInvalidSocket)
+ return;
+
+ listen_socket_.reset(new HttpListenSocket(socket_descriptor, this));
+#endif
+
listen_socket_->Listen();
}
« no previous file with comments | « google_apis/gaia/fake_gaia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698