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

Unified Diff: net/quic/quic_chromium_client_stream_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
« no previous file with comments | « net/quic/quic_chromium_client_session_test.cc ('k') | net/quic/quic_end_to_end_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_chromium_client_stream_test.cc
diff --git a/net/quic/quic_chromium_client_stream_test.cc b/net/quic/quic_chromium_client_stream_test.cc
index 7a1e5a6d4797e9df759218632f01c2cd896fdf3e..342e0b25bc34d364de780a72fd4abb31e28554a5 100644
--- a/net/quic/quic_chromium_client_stream_test.cc
+++ b/net/quic/quic_chromium_client_stream_test.cc
@@ -17,9 +17,13 @@
#include "net/quic/spdy_utils.h"
#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
+#include "net/test/gtest_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gmock_mutant.h"
+using net::test::IsError;
+using net::test::IsOk;
+
using testing::AnyNumber;
using testing::CreateFunctor;
using testing::Invoke;
@@ -401,7 +405,7 @@ TEST_P(QuicChromiumClientStreamTest, MarkTrailersConsumedWhenNotifyDelegate) {
// Read again, and it will be pending.
scoped_refptr<IOBuffer> buffer(new IOBuffer(1));
- EXPECT_EQ(ERR_IO_PENDING, stream_->Read(buffer.get(), 1));
+ EXPECT_THAT(stream_->Read(buffer.get(), 1), IsError(ERR_IO_PENDING));
SpdyHeaderBlock trailers;
trailers["bar"] = "foo";
@@ -481,7 +485,7 @@ TEST_P(QuicChromiumClientStreamTest, WriteStreamDataAsync) {
.WillOnce(Return(QuicConsumedData(kDataLen, true)));
stream_->OnCanWrite();
ASSERT_TRUE(callback.have_result());
- EXPECT_EQ(OK, callback.WaitForResult());
+ EXPECT_THAT(callback.WaitForResult(), IsOk());
}
TEST_P(QuicChromiumClientStreamTest, WritevStreamData) {
@@ -527,7 +531,7 @@ TEST_P(QuicChromiumClientStreamTest, WritevStreamDataAsync) {
.WillOnce(Return(QuicConsumedData(buf2->size(), true)));
stream_->OnCanWrite();
ASSERT_TRUE(callback.have_result());
- EXPECT_EQ(OK, callback.WaitForResult());
+ EXPECT_THAT(callback.WaitForResult(), IsOk());
}
TEST_P(QuicChromiumClientStreamTest, HeadersBeforeDelegate) {
« no previous file with comments | « net/quic/quic_chromium_client_session_test.cc ('k') | net/quic/quic_end_to_end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698