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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 11778016: net: Stop using base::WorkerPool from UploadFileElementReader (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix CF Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #endif 10 #endif
(...skipping 3139 matching lines...) Expand 10 before | Expand all | Expand 10 after
3150 3150
3151 ScopedVector<UploadElementReader> element_readers; 3151 ScopedVector<UploadElementReader> element_readers;
3152 3152
3153 FilePath path; 3153 FilePath path;
3154 PathService::Get(base::DIR_SOURCE_ROOT, &path); 3154 PathService::Get(base::DIR_SOURCE_ROOT, &path);
3155 path = path.Append(FILE_PATH_LITERAL("net")); 3155 path = path.Append(FILE_PATH_LITERAL("net"));
3156 path = path.Append(FILE_PATH_LITERAL("data")); 3156 path = path.Append(FILE_PATH_LITERAL("data"));
3157 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); 3157 path = path.Append(FILE_PATH_LITERAL("url_request_unittest"));
3158 path = path.Append(FILE_PATH_LITERAL("with-headers.html")); 3158 path = path.Append(FILE_PATH_LITERAL("with-headers.html"));
3159 element_readers.push_back(new UploadFileElementReader( 3159 element_readers.push_back(new UploadFileElementReader(
3160 path, 0, kuint64max, base::Time())); 3160 base::MessageLoopProxy::current(), path, 0, kuint64max, base::Time()));
3161 3161
3162 // This file should just be ignored in the upload stream. 3162 // This file should just be ignored in the upload stream.
3163 element_readers.push_back(new UploadFileElementReader( 3163 element_readers.push_back(new UploadFileElementReader(
3164 base::MessageLoopProxy::current(),
3164 FilePath(FILE_PATH_LITERAL( 3165 FilePath(FILE_PATH_LITERAL(
3165 "c:\\path\\to\\non\\existant\\file.randomness.12345")), 3166 "c:\\path\\to\\non\\existant\\file.randomness.12345")),
3166 0, kuint64max, base::Time())); 3167 0, kuint64max, base::Time()));
3167 r.set_upload(make_scoped_ptr(new UploadDataStream(&element_readers, 0))); 3168 r.set_upload(make_scoped_ptr(new UploadDataStream(&element_readers, 0)));
3168 3169
3169 r.Start(); 3170 r.Start();
3170 EXPECT_TRUE(r.is_pending()); 3171 EXPECT_TRUE(r.is_pending());
3171 3172
3172 MessageLoop::current()->Run(); 3173 MessageLoop::current()->Run();
3173 3174
(...skipping 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
5188 5189
5189 EXPECT_FALSE(r.is_pending()); 5190 EXPECT_FALSE(r.is_pending());
5190 EXPECT_EQ(1, d->response_started_count()); 5191 EXPECT_EQ(1, d->response_started_count());
5191 EXPECT_FALSE(d->received_data_before_response()); 5192 EXPECT_FALSE(d->received_data_before_response());
5192 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); 5193 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size));
5193 } 5194 }
5194 } 5195 }
5195 #endif // !defined(DISABLE_FTP_SUPPORT) 5196 #endif // !defined(DISABLE_FTP_SUPPORT)
5196 5197
5197 } // namespace net 5198 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_network_transaction_spdy3_unittest.cc ('k') | webkit/glue/resource_request_body.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698