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

Unified Diff: net/http/http_stream_parser_unittest.cc

Issue 1421793007: Fix ScopedTempDir in net_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | net/url_request/url_request_file_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser_unittest.cc
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc
index 012960606c1115f65f9555d18d76ccca04895d28..b431549fe83337713fc9f6c743cd97636a2e36d7 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -146,16 +146,15 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_ChunkedBody) {
}
TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_FileBody) {
+ // Create an empty temporary file.
+ base::ScopedTempDir temp_dir;
+ ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ base::FilePath temp_file_path;
+ ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &temp_file_path));
+
{
ScopedVector<UploadElementReader> element_readers;
- // Create an empty temporary file.
- base::ScopedTempDir temp_dir;
- ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- base::FilePath temp_file_path;
- ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(),
- &temp_file_path));
-
element_readers.push_back(
new UploadFileElementReader(base::ThreadTaskRunnerHandle::Get().get(),
temp_file_path, 0, 0, base::Time()));
@@ -169,6 +168,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_FileBody) {
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
}
+
// UploadFileElementReaders may post clean-up tasks on destruction.
base::RunLoop().RunUntilIdle();
}
« no previous file with comments | « no previous file | net/url_request/url_request_file_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698