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

Unified Diff: net/udp/udp_socket_perftest.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/test/embedded_test_server/embedded_test_server_unittest.cc ('k') | net/udp/udp_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_perftest.cc
diff --git a/net/udp/udp_socket_perftest.cc b/net/udp/udp_socket_perftest.cc
index 8441a0ecdc4066f056baae3ca64f29629b02a7ad..c0c1db27bff2ce64eef975ec0b559ec408ea0f9e 100644
--- a/net/udp/udp_socket_perftest.cc
+++ b/net/udp/udp_socket_perftest.cc
@@ -11,13 +11,17 @@
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
+#include "net/test/gtest_util.h"
#include "net/test/net_test_suite.h"
#include "net/udp/udp_client_socket.h"
#include "net/udp/udp_server_socket.h"
#include "net/udp/udp_socket.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+using net::test::IsOk;
+
namespace net {
namespace {
@@ -95,7 +99,7 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
server->UseNonBlockingIO();
#endif
int rv = server->Listen(bind_address);
- ASSERT_EQ(OK, rv);
+ ASSERT_THAT(rv, IsOk());
// Setup the client.
IPEndPoint server_address;
@@ -108,7 +112,7 @@ void UDPSocketPerfTest::WriteBenchmark(bool use_nonblocking_io) {
client->UseNonBlockingIO();
#endif
rv = client->Connect(server_address);
- EXPECT_EQ(OK, rv);
+ EXPECT_THAT(rv, IsOk());
base::RunLoop run_loop;
base::TimeTicks start_ticks = base::TimeTicks::Now();
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server_unittest.cc ('k') | net/udp/udp_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698