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

Unified Diff: util/net/http_transport_test.cc

Issue 799083003: util_test: Don’t crash when run from the wrong location (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback, round 2 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 | « util/net/http_multipart_builder_test.cc ('k') | util/test/multiprocess_exec_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_transport_test.cc
diff --git a/util/net/http_transport_test.cc b/util/net/http_transport_test.cc
index 974e9f05411a1152b7c69e9593e94c2043220cd7..86e43af2dcc9561a0313c53b1e53a09f909acd4c 100644
--- a/util/net/http_transport_test.cc
+++ b/util/net/http_transport_test.cc
@@ -57,14 +57,18 @@ class HTTPTransportTestFixture : public MultiprocessExec {
private:
void MultiprocessParent() override {
+ // Use Logging*FD() instead of Checked*FD() so that the test can fail
+ // gracefully with a gtest assertion if the child does not execute properly.
+
// The child will write the HTTP server port number as a packed unsigned
// short to stdout.
uint16_t port;
- CheckedReadFD(ReadPipeFD(), &port, sizeof(port));
+ ASSERT_TRUE(LoggingReadFD(ReadPipeFD(), &port, sizeof(port)));
// Then the parent will tell the web server what response code to send
// for the HTTP request.
- CheckedWriteFD(WritePipeFD(), &response_code_, sizeof(response_code_));
+ ASSERT_TRUE(
+ LoggingWriteFD(WritePipeFD(), &response_code_, sizeof(response_code_)));
// Now execute the HTTP request.
scoped_ptr<HTTPTransport> transport(HTTPTransport::Create());
« no previous file with comments | « util/net/http_multipart_builder_test.cc ('k') | util/test/multiprocess_exec_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698