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

Unified Diff: net/http/http_chunked_decoder_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/http/http_cache_unittest.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_chunked_decoder_unittest.cc
diff --git a/net/http/http_chunked_decoder_unittest.cc b/net/http/http_chunked_decoder_unittest.cc
index 2cd4fc172d3d5b6eb76c6ed7a995ea7658bbaa25..dd901a94ce8383dc9ab9629bd9ef1899719b92d9 100644
--- a/net/http/http_chunked_decoder_unittest.cc
+++ b/net/http/http_chunked_decoder_unittest.cc
@@ -7,8 +7,13 @@
#include <memory>
#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::IsError;
+using net::test::IsOk;
+
namespace net {
namespace {
@@ -49,7 +54,7 @@ void RunTestUntilFailure(const char* const inputs[],
std::string input = inputs[i];
int n = decoder.FilterBuf(&input[0], static_cast<int>(input.size()));
if (n < 0) {
- EXPECT_EQ(ERR_INVALID_CHUNKED_ENCODING, n);
+ EXPECT_THAT(n, IsError(ERR_INVALID_CHUNKED_ENCODING));
EXPECT_EQ(fail_index, i);
return;
}
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698