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

Unified Diff: content/child/web_url_loader_impl_unittest.cc

Issue 1103813002: Make WebURLLoader capable of retaining received buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « content/child/web_url_loader_impl.cc ('k') | content/content_child.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_url_loader_impl_unittest.cc
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc
index 7a48565e315a99ad313fcb7fa33469c099d0e2cd..395a663d95722ce40446b0535c8cd8900d4d8f5b 100644
--- a/content/child/web_url_loader_impl_unittest.cc
+++ b/content/child/web_url_loader_impl_unittest.cc
@@ -5,6 +5,7 @@
#include "content/child/web_url_loader_impl.h"
#include <string.h>
+#include <vector>
#include "base/command_line.h"
#include "base/macros.h"
@@ -15,6 +16,7 @@
#include "content/child/request_extra_data.h"
#include "content/child/request_info.h"
#include "content/child/resource_dispatcher.h"
+#include "content/public/child/fixed_received_data.h"
#include "content/public/child/request_peer.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/resource_response_info.h"
@@ -285,7 +287,8 @@ class WebURLLoaderImplTest : public testing::Test {
// Assumes it is called only once for a request.
void DoReceiveData() {
EXPECT_EQ("", client()->received_data());
- peer()->OnReceivedData(kTestData, strlen(kTestData), strlen(kTestData));
+ peer()->OnReceivedData(make_scoped_ptr(new FixedReceivedData(
+ kTestData, strlen(kTestData), strlen(kTestData))));
EXPECT_EQ(kTestData, client()->received_data());
}
@@ -317,8 +320,8 @@ class WebURLLoaderImplTest : public testing::Test {
}
void DoReceiveDataFtp() {
- peer()->OnReceivedData(kFtpDirListing, strlen(kFtpDirListing),
- strlen(kFtpDirListing));
+ peer()->OnReceivedData(make_scoped_ptr(new FixedReceivedData(
+ kFtpDirListing, strlen(kFtpDirListing), strlen(kFtpDirListing))));
// The FTP delegate should modify the data the client sees.
EXPECT_NE(kFtpDirListing, client()->received_data());
}
@@ -335,8 +338,9 @@ class WebURLLoaderImplTest : public testing::Test {
}
void DoReceiveDataMultipart() {
- peer()->OnReceivedData(kMultipartResponse, strlen(kMultipartResponse),
- strlen(kMultipartResponse));
+ peer()->OnReceivedData(make_scoped_ptr(
+ new FixedReceivedData(kMultipartResponse, strlen(kMultipartResponse),
+ strlen(kMultipartResponse))));
// Multipart delegate should modify the data the client sees.
EXPECT_NE(kMultipartResponse, client()->received_data());
}
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/content_child.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698