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

Unified Diff: util/net/http_body_test.cc

Issue 681303003: Add HTTPMultipartBuilder and its test. (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Assert safe MIME types Created 6 years, 2 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 | « no previous file | util/net/http_body_test_util.h » ('j') | util/net/http_multipart_builder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_body_test.cc
diff --git a/util/net/http_body_test.cc b/util/net/http_body_test.cc
index c15fe4f02a7a5dda4063a36311656c7b69dcb036..cccc31217130bc0bdaee63d088808349ac887ded 100644
--- a/util/net/http_body_test.cc
+++ b/util/net/http_body_test.cc
@@ -16,6 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "gtest/gtest.h"
+#include "util/net/http_body_test_util.h"
namespace crashpad {
namespace test {
@@ -92,23 +93,6 @@ TEST(StringHTTPBodyStream, MultipleReads) {
}
}
-std::string ReadStreamToString(HTTPBodyStream* stream, size_t buffer_size) {
- scoped_ptr<uint8_t[]> buf(new uint8_t[buffer_size]);
- std::string result;
-
- ssize_t bytes_read;
- while ((bytes_read = stream->GetBytesBuffer(buf.get(), buffer_size)) != 0) {
- if (bytes_read < 0) {
- ADD_FAILURE() << "Failed to read from stream: " << bytes_read;
- return std::string();
- }
-
- result.append(reinterpret_cast<char*>(buf.get()), bytes_read);
- }
-
- return result;
-}
-
TEST(FileHTTPBodyStream, ReadASCIIFile) {
// TODO(rsesek): Use a more robust mechanism to locate testdata
// <https://code.google.com/p/crashpad/issues/detail?id=4>.
« no previous file with comments | « no previous file | util/net/http_body_test_util.h » ('j') | util/net/http_multipart_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698