| Index: chrome/test/chromedriver/net/net_util_unittest.cc
|
| diff --git a/chrome/test/chromedriver/net/net_util_unittest.cc b/chrome/test/chromedriver/net/net_util_unittest.cc
|
| index e4d8b14db1afdfbd569eab18e8acfe49fa2c203e..753b115c0fdc22cc3a356d32f6ed7b026a4f18d6 100644
|
| --- a/chrome/test/chromedriver/net/net_util_unittest.cc
|
| +++ b/chrome/test/chromedriver/net/net_util_unittest.cc
|
| @@ -20,7 +20,6 @@
|
| #include "net/base/net_errors.h"
|
| #include "net/server/http_server.h"
|
| #include "net/server/http_server_request_info.h"
|
| -#include "net/socket/tcp_listen_socket.h"
|
| #include "net/url_request/url_request_context_getter.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -54,8 +53,8 @@ class FetchUrlTest : public testing::Test,
|
| }
|
|
|
| void InitOnIO(base::WaitableEvent* event) {
|
| - net::TCPListenSocketFactory factory("127.0.0.1", 0);
|
| - server_ = new net::HttpServer(factory, this);
|
| + server_.reset(net::HttpServer::Create("127.0.0.1", 0, this));
|
| + DCHECK(server_);
|
| net::IPEndPoint address;
|
| CHECK_EQ(net::OK, server_->GetLocalAddress(&address));
|
| server_url_ = base::StringPrintf("http://127.0.0.1:%d", address.port());
|
| @@ -63,7 +62,7 @@ class FetchUrlTest : public testing::Test,
|
| }
|
|
|
| void DestroyServerOnIO(base::WaitableEvent* event) {
|
| - server_ = NULL;
|
| + server_.reset(NULL);
|
| event->Signal();
|
| }
|
|
|
| @@ -81,7 +80,8 @@ class FetchUrlTest : public testing::Test,
|
| // net::HttpServer doesn't allow us to close connection during callback.
|
| base::MessageLoop::current()->PostTask(
|
| FROM_HERE,
|
| - base::Bind(&net::HttpServer::Close, server_, connection_id));
|
| + base::Bind(&net::HttpServer::Close, server_->AsWeakPtr(),
|
| + connection_id));
|
| break;
|
| default:
|
| break;
|
| @@ -104,7 +104,7 @@ class FetchUrlTest : public testing::Test,
|
|
|
| base::Thread io_thread_;
|
| ServerResponse response_;
|
| - scoped_refptr<net::HttpServer> server_;
|
| + scoped_ptr<net::HttpServer> server_;
|
| scoped_refptr<URLRequestContextGetter> context_getter_;
|
| std::string server_url_;
|
| };
|
|
|