diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 23:44:57 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 23:44:57 +0000 |
commit | dd54bd86ae45868728991c656afd46237dd1efdd (patch) | |
tree | 24533f32d9590d6430de47c162b679a639ecd1f3 /net/socket | |
parent | c9bdcbdb323f5f7ca6d06f8c3e6426a9074d72b5 (diff) | |
download | chromium_src-dd54bd86ae45868728991c656afd46237dd1efdd.zip chromium_src-dd54bd86ae45868728991c656afd46237dd1efdd.tar.gz chromium_src-dd54bd86ae45868728991c656afd46237dd1efdd.tar.bz2 |
Remove most usages of scoped_ptr<*SocketData> in net unittests.
This anti-pattern simply complicates tests and adds no value.
Review URL: https://chromiumcodereview.appspot.com/10809022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r-- | net/socket/socks_client_socket_pool_unittest.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/net/socket/socks_client_socket_pool_unittest.cc b/net/socket/socks_client_socket_pool_unittest.cc index bb6b125..70c769b 100644 --- a/net/socket/socks_client_socket_pool_unittest.cc +++ b/net/socket/socks_client_socket_pool_unittest.cc @@ -127,10 +127,10 @@ TEST_F(SOCKSClientSocketPoolTest, Async) { } TEST_F(SOCKSClientSocketPoolTest, TransportConnectError) { - scoped_ptr<SocketDataProvider> socket_data(new StaticSocketDataProvider()); - socket_data->set_connect_data(MockConnect(SYNCHRONOUS, - ERR_CONNECTION_REFUSED)); - transport_client_socket_factory_.AddSocketDataProvider(socket_data.get()); + StaticSocketDataProvider socket_data; + socket_data.set_connect_data(MockConnect(SYNCHRONOUS, + ERR_CONNECTION_REFUSED)); + transport_client_socket_factory_.AddSocketDataProvider(&socket_data); ClientSocketHandle handle; int rv = handle.Init("a", ignored_socket_params_, LOW, CompletionCallback(), @@ -141,9 +141,9 @@ TEST_F(SOCKSClientSocketPoolTest, TransportConnectError) { } TEST_F(SOCKSClientSocketPoolTest, AsyncTransportConnectError) { - scoped_ptr<SocketDataProvider> socket_data(new StaticSocketDataProvider()); - socket_data->set_connect_data(MockConnect(ASYNC, ERR_CONNECTION_REFUSED)); - transport_client_socket_factory_.AddSocketDataProvider(socket_data.get()); + StaticSocketDataProvider socket_data; + socket_data.set_connect_data(MockConnect(ASYNC, ERR_CONNECTION_REFUSED)); + transport_client_socket_factory_.AddSocketDataProvider(&socket_data); TestCompletionCallback callback; ClientSocketHandle handle; @@ -162,10 +162,10 @@ TEST_F(SOCKSClientSocketPoolTest, SOCKSConnectError) { MockRead failed_read[] = { MockRead(SYNCHRONOUS, 0), }; - scoped_ptr<SocketDataProvider> socket_data(new StaticSocketDataProvider( - failed_read, arraysize(failed_read), NULL, 0)); - socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); - transport_client_socket_factory_.AddSocketDataProvider(socket_data.get()); + StaticSocketDataProvider socket_data( + failed_read, arraysize(failed_read), NULL, 0); + socket_data.set_connect_data(MockConnect(SYNCHRONOUS, OK)); + transport_client_socket_factory_.AddSocketDataProvider(&socket_data); ClientSocketHandle handle; EXPECT_EQ(0, transport_socket_pool_.release_count()); @@ -181,10 +181,10 @@ TEST_F(SOCKSClientSocketPoolTest, AsyncSOCKSConnectError) { MockRead failed_read[] = { MockRead(ASYNC, 0), }; - scoped_ptr<SocketDataProvider> socket_data(new StaticSocketDataProvider( - failed_read, arraysize(failed_read), NULL, 0)); - socket_data->set_connect_data(MockConnect(SYNCHRONOUS, OK)); - transport_client_socket_factory_.AddSocketDataProvider(socket_data.get()); + StaticSocketDataProvider socket_data( + failed_read, arraysize(failed_read), NULL, 0); + socket_data.set_connect_data(MockConnect(SYNCHRONOUS, OK)); + transport_client_socket_factory_.AddSocketDataProvider(&socket_data); TestCompletionCallback callback; ClientSocketHandle handle; |