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

Unified Diff: util/net/http_multipart_builder_test.cc

Issue 814683003: win: FILE_PATH_LITERALs in http_multipart_builder_test.cc (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@http-body-test
Patch Set: Created 5 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/net/http_multipart_builder_test.cc
diff --git a/util/net/http_multipart_builder_test.cc b/util/net/http_multipart_builder_test.cc
index 1e8d59458f7ff8d92375716167cd5e649c2b7c4f..cb3fbaa7a5ec4e6633c2c71df78251151226e6a5 100644
--- a/util/net/http_multipart_builder_test.cc
+++ b/util/net/http_multipart_builder_test.cc
@@ -97,12 +97,21 @@ TEST(HTTPMultipartBuilder, ThreeFileAttachments) {
HTTPMultipartBuilder builder;
// TODO(rsesek): Use a more robust mechanism to locate testdata
// <https://code.google.com/p/crashpad/issues/detail?id=4>.
- builder.SetFileAttachment("first", "minidump.dmp",
- base::FilePath("util/net/testdata/ascii_http_body.txt"), "");
- builder.SetFileAttachment("second", "minidump.dmp",
- base::FilePath("util/net/testdata/ascii_http_body.txt"), "text/plain");
- builder.SetFileAttachment("\"third 50% silly\"", "test%foo.txt",
- base::FilePath("util/net/testdata/ascii_http_body.txt"), "text/plain");
+ builder.SetFileAttachment("first",
+ "minidump.dmp",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/ascii_http_body.txt")),
+ "");
+ builder.SetFileAttachment("second",
+ "minidump.dmp",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/ascii_http_body.txt")),
+ "text/plain");
+ builder.SetFileAttachment("\"third 50% silly\"",
+ "test%foo.txt",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/ascii_http_body.txt")),
+ "text/plain");
const char kFileContents[] = "This is a test.\n";
@@ -175,12 +184,21 @@ TEST(HTTPMultipartBuilder, OverwriteFileAttachment) {
builder.SetFormData("a key", kValue);
// TODO(rsesek): Use a more robust mechanism to locate testdata
// <https://code.google.com/p/crashpad/issues/detail?id=4>.
- builder.SetFileAttachment("minidump", "minidump.dmp",
- base::FilePath("util/net/testdata/binary_http_body.dat"), "");
- builder.SetFileAttachment("minidump2", "minidump.dmp",
- base::FilePath("util/net/testdata/binary_http_body.dat"), "");
- builder.SetFileAttachment("minidump", "minidump.dmp",
- base::FilePath("util/net/testdata/ascii_http_body.txt"), "text/plain");
+ builder.SetFileAttachment("minidump",
+ "minidump.dmp",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/binary_http_body.dat")),
+ "");
+ builder.SetFileAttachment("minidump2",
+ "minidump.dmp",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/binary_http_body.dat")),
+ "");
+ builder.SetFileAttachment("minidump",
+ "minidump.dmp",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/ascii_http_body.txt")),
+ "text/plain");
scoped_ptr<HTTPBodyStream> body(builder.GetBodyStream());
ASSERT_TRUE(body.get());
std::string contents = ReadStreamToString(body.get());
@@ -221,8 +239,11 @@ TEST(HTTPMultipartBuilder, SharedFormDataAndAttachmentKeyNamespace) {
HTTPMultipartBuilder builder;
const char kValue1[] = "11111";
builder.SetFormData("one", kValue1);
- builder.SetFileAttachment("minidump", "minidump.dmp",
- base::FilePath("util/net/testdata/ascii_http_body.txt"), "");
+ builder.SetFileAttachment("minidump",
+ "minidump.dmp",
+ base::FilePath(FILE_PATH_LITERAL(
+ "util/net/testdata/ascii_http_body.txt")),
+ "");
const char kValue2[] = "this is not a file";
builder.SetFormData("minidump", kValue2);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698