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

Unified Diff: components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc

Issue 789353003: Fix CryptAuthApiCallFlow resulting in an error if the server returns an empty string. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « components/proximity_auth/cryptauth/cryptauth_api_call_flow.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc
diff --git a/components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc b/components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc
index 2d1cf5cdf506dad2deb6b50575975ae321c0ffc4..53417e724249443f91fb9a51f48b800769b59723 100644
--- a/components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc
+++ b/components/proximity_auth/cryptauth/cryptauth_api_call_flow_unittest.cc
@@ -102,6 +102,8 @@ class ProximityAuthCryptAuthApiCallFlowTest
scoped_refptr<net::TestURLRequestContextGetter> url_request_context_getter_;
scoped_ptr<net::TestURLFetcherFactory> url_fetcher_factory_;
CryptAuthApiCallFlow flow_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProximityAuthCryptAuthApiCallFlowTest);
};
TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestSuccess) {
@@ -128,12 +130,13 @@ TEST_F(ProximityAuthCryptAuthApiCallFlowTest, RequestStatus500) {
EXPECT_EQ("HTTP status: 500", *error_message_);
}
+// The empty string is a valid protocol buffer message serialization.
TEST_F(ProximityAuthCryptAuthApiCallFlowTest, ResponseWithNoBody) {
StartApiCallFlow();
CompleteCurrentRequest(
net::URLRequestStatus::SUCCESS, net::HTTP_OK, std::string());
- EXPECT_FALSE(result_);
- EXPECT_EQ("No response body", *error_message_);
+ EXPECT_EQ(std::string(), *result_);
+ EXPECT_FALSE(error_message_);
}
Ilya Sherman 2014/12/10 23:38:29 Please add a new test to provide coverage for the
Tim Song 2014/12/11 00:12:55 Hmm... I'm note sure how to force this error, as t
} // namespace proximity_auth
« no previous file with comments | « components/proximity_auth/cryptauth/cryptauth_api_call_flow.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698