| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 expect_response_body += "\r\n"; | 114 expect_response_body += "\r\n"; |
| 115 EXPECT_EQ(expect_response_body, response_body); | 115 EXPECT_EQ(expect_response_body, response_body); |
| 116 } else { | 116 } else { |
| 117 EXPECT_FALSE(success); | 117 EXPECT_FALSE(success); |
| 118 EXPECT_TRUE(response_body.empty()); | 118 EXPECT_TRUE(response_body.empty()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 // Read until the child's stdout closes. | 121 // Read until the child's stdout closes. |
| 122 std::string request; | 122 std::string request; |
| 123 char buf[32]; | 123 char buf[32]; |
| 124 ssize_t bytes_read; | 124 FileOperationResult bytes_read; |
| 125 while ((bytes_read = ReadFile(ReadPipeHandle(), buf, sizeof(buf))) != 0) { | 125 while ((bytes_read = ReadFile(ReadPipeHandle(), buf, sizeof(buf))) != 0) { |
| 126 ASSERT_GE(bytes_read, 0); | 126 ASSERT_GE(bytes_read, 0); |
| 127 request.append(buf, bytes_read); | 127 request.append(buf, bytes_read); |
| 128 } | 128 } |
| 129 | 129 |
| 130 if (request_validator_) | 130 if (request_validator_) |
| 131 request_validator_(this, request); | 131 request_validator_(this, request); |
| 132 } | 132 } |
| 133 | 133 |
| 134 HTTPHeaders headers_; | 134 HTTPHeaders headers_; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 307 } |
| 308 | 308 |
| 309 TEST(HTTPTransport, Upload33k_LengthUnknown) { | 309 TEST(HTTPTransport, Upload33k_LengthUnknown) { |
| 310 // The same as Upload33k, but without declaring Content-Length ahead of time. | 310 // The same as Upload33k, but without declaring Content-Length ahead of time. |
| 311 RunUpload33k(false); | 311 RunUpload33k(false); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace | 314 } // namespace |
| 315 } // namespace test | 315 } // namespace test |
| 316 } // namespace crashpad | 316 } // namespace crashpad |
| OLD | NEW |