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

Unified Diff: chrome_frame/test/test_server.cc

Issue 10868027: Attempt to fix flake in FullTabModeIE_TestPostReissue by avoiding loopback address. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another try with net tests Created 8 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 | « chrome_frame/test/test_server.h ('k') | chrome_frame/test/test_server_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/test_server.cc
diff --git a/chrome_frame/test/test_server.cc b/chrome_frame/test/test_server.cc
index 5eaf06f6e9f56616a2463aa5f4cf7711e05838d3..83946c68eb6c3d4bcc1861cf43e897a2c24d00b6 100644
--- a/chrome_frame/test/test_server.cc
+++ b/chrome_frame/test/test_server.cc
@@ -13,6 +13,7 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
+#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/test_server.h"
#include "net/base/tcp_listen_socket.h"
#include "net/base/winsock_init.h"
@@ -136,11 +137,11 @@ bool RedirectResponse::GetCustomHeaders(std::string* headers) const {
}
SimpleWebServer::SimpleWebServer(int port) {
- CHECK(MessageLoop::current()) << "SimpleWebServer requires a message loop";
- net::EnsureWinsockInit();
- AddResponse(&quit_);
- server_ = net::TCPListenSocket::CreateAndListen("127.0.0.1", port, this);
- DCHECK(server_.get() != NULL);
+ Construct(chrome_frame_test::GetLocalIPv4Address(), port);
+}
+
+SimpleWebServer::SimpleWebServer(const std::string& address, int port) {
+ Construct(address, port);
}
SimpleWebServer::~SimpleWebServer() {
@@ -150,6 +151,16 @@ SimpleWebServer::~SimpleWebServer() {
connections_.clear();
}
+void SimpleWebServer::Construct(const std::string& address, int port) {
+ CHECK(MessageLoop::current()) << "SimpleWebServer requires a message loop";
+ net::EnsureWinsockInit();
+ AddResponse(&quit_);
+ host_ = address;
+ server_ = net::TCPListenSocket::CreateAndListen(address, port, this);
+ LOG_IF(DFATAL, !server_.get())
+ << "Failed to create listener socket at " << address << ":" << port;
+}
+
void SimpleWebServer::AddResponse(Response* response) {
responses_.push_back(response);
}
« no previous file with comments | « chrome_frame/test/test_server.h ('k') | chrome_frame/test/test_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698