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

Unified Diff: net/socket/sequenced_socket_data_unittest.cc

Issue 2109503009: Refactor net tests to use GMock matchers for checking net::Error results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to contents.txt files Created 4 years, 6 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 | « net/socket/client_socket_pool_base_unittest.cc ('k') | net/socket/socks5_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/sequenced_socket_data_unittest.cc
diff --git a/net/socket/sequenced_socket_data_unittest.cc b/net/socket/sequenced_socket_data_unittest.cc
index e72c01c1271cc513633917dfd2d45381bcce4430..337ae745f3bf033db12d7763704ccdfd6de857e2 100644
--- a/net/socket/sequenced_socket_data_unittest.cc
+++ b/net/socket/sequenced_socket_data_unittest.cc
@@ -13,10 +13,15 @@
#include "net/socket/client_socket_handle.h"
#include "net/socket/socket_test_util.h"
#include "net/socket/transport_client_socket_pool.h"
+#include "net/test/gtest_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest-spi.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+using net::test::IsError;
+using net::test::IsOk;
+
//-----------------------------------------------------------------------------
namespace net {
@@ -381,7 +386,8 @@ void SequencedSocketDataTest::ReentrantAsyncWriteCallback(
EXPECT_EQ(expected_rv, rv);
scoped_refptr<IOBuffer> write_buf(new IOBuffer(len));
memcpy(write_buf->data(), data, len);
- EXPECT_EQ(ERR_IO_PENDING, sock_->Write(write_buf.get(), len, callback));
+ EXPECT_THAT(sock_->Write(write_buf.get(), len, callback),
+ IsError(ERR_IO_PENDING));
}
void SequencedSocketDataTest::FailingCompletionCallback(int rv) {
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | net/socket/socks5_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698