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

Unified Diff: net/websockets/websocket_errors_test.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
Index: net/websockets/websocket_errors_test.cc
diff --git a/net/websockets/websocket_errors_test.cc b/net/websockets/websocket_errors_test.cc
index 5e48e20e83183ec1b39fcd6b49bae330db37a98c..95147c70b88c407c5f73710dcbfcb5ccd48d67f7 100644
--- a/net/websockets/websocket_errors_test.cc
+++ b/net/websockets/websocket_errors_test.cc
@@ -5,8 +5,12 @@
#include "net/websockets/websocket_errors.h"
#include "net/base/net_errors.h"
+#include "net/test/gtest_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using net::test::IsOk;
+
namespace net {
namespace {
@@ -14,7 +18,7 @@ namespace {
// don't exhaustively test every error code, as it would be long, repetitive,
// and add little value.
TEST(WebSocketErrorToNetErrorTest, ResultsAreCorrect) {
- EXPECT_EQ(OK, WebSocketErrorToNetError(kWebSocketNormalClosure));
+ EXPECT_THAT(WebSocketErrorToNetError(kWebSocketNormalClosure), IsOk());
EXPECT_EQ(ERR_WS_PROTOCOL_ERROR,
WebSocketErrorToNetError(kWebSocketErrorProtocolError));
EXPECT_EQ(ERR_MSG_TOO_BIG,
« no previous file with comments | « net/websockets/websocket_deflate_stream_test.cc ('k') | net/websockets/websocket_handshake_stream_create_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698