diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 21:02:36 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-17 21:02:36 +0000 |
commit | d973e99aa66ee6a8867ecb076bec8bdda7445e14 (patch) | |
tree | 309364d47ac5680ce500f787d7faeb9dfb188a56 /jingle | |
parent | 269695f82b5352b8684ea0abcb183e859a362d95 (diff) | |
download | chromium_src-d973e99aa66ee6a8867ecb076bec8bdda7445e14.zip chromium_src-d973e99aa66ee6a8867ecb076bec8bdda7445e14.tar.gz chromium_src-d973e99aa66ee6a8867ecb076bec8bdda7445e14.tar.bz2 |
Modify the MockConnect constructor to take an enum of ASYNC or SYNCHRONOUS,
instead of a boolean async.
Review URL: http://codereview.chromium.org/9419032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
3 files changed, 15 insertions, 13 deletions
diff --git a/jingle/notifier/base/chrome_async_socket_unittest.cc b/jingle/notifier/base/chrome_async_socket_unittest.cc index a86b5c8..1f16e3a 100644 --- a/jingle/notifier/base/chrome_async_socket_unittest.cc +++ b/jingle/notifier/base/chrome_async_socket_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -342,7 +342,7 @@ class ChromeAsyncSocketTest void DoOpenClosed() { ExpectClosed(); async_socket_data_provider_.set_connect_data( - net::MockConnect(false, net::OK)); + net::MockConnect(net::SYNCHRONOUS, net::OK)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING); @@ -519,7 +519,7 @@ TEST_F(ChromeAsyncSocketTest, HangingConnect) { TEST_F(ChromeAsyncSocketTest, PendingConnect) { async_socket_data_provider_.set_connect_data( - net::MockConnect(true, net::OK)); + net::MockConnect(net::ASYNC, net::OK)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING); ExpectNoSignal(); @@ -541,7 +541,7 @@ TEST_F(ChromeAsyncSocketTest, PendingConnect) { TEST_F(ChromeAsyncSocketTest, PendingConnectCloseBeforeRead) { async_socket_data_provider_.set_connect_data( - net::MockConnect(true, net::OK)); + net::MockConnect(net::ASYNC, net::OK)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); message_loop_.RunAllPending(); @@ -556,7 +556,7 @@ TEST_F(ChromeAsyncSocketTest, PendingConnectCloseBeforeRead) { TEST_F(ChromeAsyncSocketTest, PendingConnectError) { async_socket_data_provider_.set_connect_data( - net::MockConnect(true, net::ERR_TIMED_OUT)); + net::MockConnect(net::ASYNC, net::ERR_TIMED_OUT)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); message_loop_.RunAllPending(); @@ -583,7 +583,7 @@ TEST_F(ChromeAsyncSocketTest, EmptyRead) { TEST_F(ChromeAsyncSocketTest, WrongRead) { EXPECT_DEBUG_DEATH({ async_socket_data_provider_.set_connect_data( - net::MockConnect(true, net::OK)); + net::MockConnect(net::ASYNC, net::OK)); EXPECT_TRUE(chrome_async_socket_->Connect(addr_)); ExpectNonErrorState(ChromeAsyncSocket::STATE_CONNECTING); ExpectNoSignal(); @@ -897,7 +897,7 @@ TEST_F(ChromeAsyncSocketTest, DoubleSSLConnect) { TEST_F(ChromeAsyncSocketTest, FailedSSLConnect) { ssl_socket_data_provider_.connect = - net::MockConnect(true, net::ERR_CERT_COMMON_NAME_INVALID), + net::MockConnect(net::ASYNC, net::ERR_CERT_COMMON_NAME_INVALID), async_socket_data_provider_.AddRead(net::MockRead(kReadData)); DoOpenClosed(); diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc index 1a3260d..f54ed10 100644 --- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc +++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -131,7 +131,8 @@ class FakeSSLClientSocketTest : public testing::Test { base::StringPiece ssl_server_hello = FakeSSLClientSocket::GetSslServerHello(); - net::MockConnect mock_connect(async, net::OK); + net::MockConnect mock_connect(async ? net::ASYNC : net::SYNCHRONOUS, + net::OK); std::vector<net::MockRead> reads; std::vector<net::MockWrite> writes; static const char kReadTestData[] = "read test data"; @@ -192,7 +193,8 @@ class FakeSSLClientSocketTest : public testing::Test { base::StringPiece ssl_server_hello = FakeSSLClientSocket::GetSslServerHello(); - net::MockConnect mock_connect(async, net::OK); + net::MockConnect mock_connect(async ? net::ASYNC : net::SYNCHRONOUS, + net::OK); std::vector<net::MockRead> reads; std::vector<net::MockWrite> writes; const size_t kChunkSize = 1; diff --git a/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc b/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc index e1f4480..ab9253b 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -90,7 +90,7 @@ TEST_F(ProxyResolvingClientSocketTest, ReportsBadProxies) { net::StaticSocketDataProvider socket_data1; socket_data1.set_connect_data( - net::MockConnect(true, net::ERR_ADDRESS_UNREACHABLE)); + net::MockConnect(net::ASYNC, net::ERR_ADDRESS_UNREACHABLE)); socket_factory.AddSocketDataProvider(&socket_data1); net::MockRead reads[] = { @@ -103,7 +103,7 @@ TEST_F(ProxyResolvingClientSocketTest, ReportsBadProxies) { }; net::StaticSocketDataProvider socket_data2(reads, arraysize(reads), writes, arraysize(writes)); - socket_data2.set_connect_data(net::MockConnect(true, net::OK)); + socket_data2.set_connect_data(net::MockConnect(net::ASYNC, net::OK)); socket_factory.AddSocketDataProvider(&socket_data2); ProxyResolvingClientSocket proxy_resolving_socket( |