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

Unified Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 11439008: net: Change argument of URLRequest::set_upload from UploadData to UploadDataStream (Closed) Base URL: http://git.chromium.org/chromium/src.git@chunk
Patch Set: Fix android Created 8 years 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 | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | net/base/upload_bytes_element_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_unittest.cc
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 3c9d8811ffc3fb59b981d9b58714b69c6ccc9217..e9f5efa3bb7124e78bf6f0b2ab61a2cef4cda66b 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -26,7 +26,8 @@
#include "content/public/test/test_browser_context.h"
#include "content/test/test_content_browser_client.h"
#include "net/base/net_errors.h"
-#include "net/base/upload_data.h"
+#include "net/base/upload_bytes_element_reader.h"
+#include "net/base/upload_data_stream.h"
#include "net/http/http_util.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
@@ -1289,9 +1290,10 @@ TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) {
std::string upload_content;
upload_content.resize(33);
std::fill(upload_content.begin(), upload_content.end(), 'x');
- scoped_refptr<net::UploadData> upload_data(new net::UploadData());
- upload_data->AppendBytes(upload_content.data(), upload_content.size());
- req.set_upload(upload_data);
+ scoped_ptr<net::UploadElementReader> reader(new net::UploadBytesElementReader(
+ upload_content.data(), upload_content.size()));
+ req.set_upload(make_scoped_ptr(
+ net::UploadDataStream::CreateWithReader(reader.Pass(), 0)));
// Since the upload throttling is disabled, this has no effect on the cost.
EXPECT_EQ(4436,
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | net/base/upload_bytes_element_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698