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

Unified Diff: util/net/http_body_test.cc

Issue 992503002: Locate test data more robustly (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 2015 Created 5 years, 9 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 | « build/run_tests.py ('k') | util/net/http_multipart_builder_test.cc » ('j') | no next file with comments »
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 8dbd5a1081f0b55868690d2e9765bfe5e9be7a22..8e58c2054223ca4dd6b96e20a4c70d0b1a7f1617 100644
--- a/util/net/http_body_test.cc
+++ b/util/net/http_body_test.cc
@@ -16,6 +16,7 @@
#include "gtest/gtest.h"
#include "util/net/http_body_test_util.h"
+#include "util/test/paths.h"
namespace crashpad {
namespace test {
@@ -93,9 +94,7 @@ TEST(StringHTTPBodyStream, MultipleReads) {
}
TEST(FileHTTPBodyStream, ReadASCIIFile) {
- // TODO(rsesek): Use a more robust mechanism to locate testdata
- // <https://code.google.com/p/crashpad/issues/detail?id=4>.
- base::FilePath path = base::FilePath(
+ base::FilePath path = Paths::TestDataRoot().Append(
FILE_PATH_LITERAL("util/net/testdata/ascii_http_body.txt"));
FileHTTPBodyStream stream(path);
std::string contents = ReadStreamToString(&stream, 32);
@@ -113,9 +112,7 @@ TEST(FileHTTPBodyStream, ReadASCIIFile) {
TEST(FileHTTPBodyStream, ReadBinaryFile) {
// HEX contents of file: |FEEDFACE A11A15|.
- // TODO(rsesek): Use a more robust mechanism to locate testdata
- // <https://code.google.com/p/crashpad/issues/detail?id=4>.
- base::FilePath path = base::FilePath(
+ base::FilePath path = Paths::TestDataRoot().Append(
FILE_PATH_LITERAL("util/net/testdata/binary_http_body.dat"));
// This buffer size was chosen so that reading the file takes multiple reads.
uint8_t buf[4];
@@ -199,8 +196,9 @@ TEST_P(CompositeHTTPBodyStreamBufferSize, StringsAndFile) {
std::vector<HTTPBodyStream*> parts;
parts.push_back(new StringHTTPBodyStream(string1));
- parts.push_back(new FileHTTPBodyStream(base::FilePath(
- FILE_PATH_LITERAL("util/net/testdata/ascii_http_body.txt"))));
+ base::FilePath path = Paths::TestDataRoot().Append(
+ FILE_PATH_LITERAL("util/net/testdata/ascii_http_body.txt"));
+ parts.push_back(new FileHTTPBodyStream(path));
parts.push_back(new StringHTTPBodyStream(string2));
CompositeHTTPBodyStream stream(parts);
« no previous file with comments | « build/run_tests.py ('k') | util/net/http_multipart_builder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698