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

Unified Diff: net/http/http_auth_handler_digest_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_auth_handler_basic_unittest.cc ('k') | net/http/http_auth_handler_factory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_digest_unittest.cc
diff --git a/net/http/http_auth_handler_digest_unittest.cc b/net/http/http_auth_handler_digest_unittest.cc
index 3f7e44211a0aad38fc08ef533050db54bf70d85b..9e2a47ad9c0e115b8f398314cb3c444310777953 100644
--- a/net/http/http_auth_handler_digest_unittest.cc
+++ b/net/http/http_auth_handler_digest_unittest.cc
@@ -12,8 +12,12 @@
#include "net/http/http_auth_handler_digest.h"
#include "net/http/http_request_info.h"
#include "net/ssl/ssl_info.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 {
@@ -360,7 +364,7 @@ TEST(HttpAuthHandlerDigestTest, ParseChallenge) {
tests[i].challenge, HttpAuth::AUTH_SERVER, null_ssl_info, origin,
BoundNetLog(), &handler);
if (tests[i].parsed_success) {
- EXPECT_EQ(OK, rv);
+ EXPECT_THAT(rv, IsOk());
} else {
EXPECT_NE(OK, rv);
EXPECT_TRUE(handler.get() == NULL);
@@ -523,7 +527,7 @@ TEST(HttpAuthHandlerDigestTest, AssembleCredentials) {
int rv = factory->CreateAuthHandlerFromString(
tests[i].challenge, HttpAuth::AUTH_SERVER, null_ssl_info, origin,
BoundNetLog(), &handler);
- EXPECT_EQ(OK, rv);
+ EXPECT_THAT(rv, IsOk());
ASSERT_TRUE(handler != NULL);
HttpAuthHandlerDigest* digest =
@@ -552,7 +556,7 @@ TEST(HttpAuthHandlerDigest, HandleAnotherChallenge) {
int rv = factory->CreateAuthHandlerFromString(
default_challenge, HttpAuth::AUTH_SERVER, null_ssl_info, origin,
BoundNetLog(), &handler);
- EXPECT_EQ(OK, rv);
+ EXPECT_THAT(rv, IsOk());
ASSERT_TRUE(handler.get() != NULL);
HttpAuthChallengeTokenizer tok_default(default_challenge.begin(),
default_challenge.end());
« no previous file with comments | « net/http/http_auth_handler_basic_unittest.cc ('k') | net/http/http_auth_handler_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698