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

Unified Diff: net/quic/quic_end_to_end_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/quic/quic_chromium_client_stream_test.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_end_to_end_unittest.cc
diff --git a/net/quic/quic_end_to_end_unittest.cc b/net/quic/quic_end_to_end_unittest.cc
index 15602a78ba4631f3aedfe10ae43c02c60aeaad46..30bb5f8b0421f050c324ca105a133aa71458b969 100644
--- a/net/quic/quic_end_to_end_unittest.cc
+++ b/net/quic/quic_end_to_end_unittest.cc
@@ -33,11 +33,13 @@
#include "net/ssl/default_channel_id_store.h"
#include "net/ssl/ssl_config_service_defaults.h"
#include "net/test/cert_test_util.h"
+#include "net/test/gtest_util.h"
#include "net/test/test_data_directory.h"
#include "net/tools/quic/quic_in_memory_cache.h"
#include "net/tools/quic/quic_server.h"
#include "net/tools/quic/test_tools/quic_in_memory_cache_peer.h"
#include "net/tools/quic/test_tools/server_thread.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -45,6 +47,7 @@ using base::StringPiece;
namespace net {
+using test::IsOk;
using test::QuicInMemoryCachePeer;
using test::ServerThread;
@@ -234,7 +237,8 @@ class QuicEndToEndTest : public ::testing::TestWithParam<TestParams> {
request_.method = "POST";
request_.url = GURL("https://test.example.com/");
request_.upload_data_stream = upload_data_stream_.get();
- ASSERT_EQ(OK, request_.upload_data_stream->Init(CompletionCallback()));
+ ASSERT_THAT(request_.upload_data_stream->Init(CompletionCallback()),
+ IsOk());
}
// Checks that |consumer| completed and received |status_line| and |body|.
@@ -242,7 +246,7 @@ class QuicEndToEndTest : public ::testing::TestWithParam<TestParams> {
const std::string& status_line,
const std::string& body) {
ASSERT_TRUE(consumer.is_done());
- ASSERT_EQ(OK, consumer.error());
+ ASSERT_THAT(consumer.error(), IsOk());
EXPECT_EQ(status_line, consumer.response_info()->headers->GetStatusLine());
EXPECT_EQ(body, consumer.content());
}
« no previous file with comments | « net/quic/quic_chromium_client_stream_test.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698