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

Unified Diff: webkit/glue/multipart_response_delegate_unittest.cc

Issue 661445: Avoid having every frame of a multipart response create a (Closed)
Patch Set: with unittest Created 10 years, 10 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 | « webkit/glue/multipart_response_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/multipart_response_delegate_unittest.cc
diff --git a/webkit/glue/multipart_response_delegate_unittest.cc b/webkit/glue/multipart_response_delegate_unittest.cc
index b8d5fbe27c60012c7335558f9c33917bcd6403a8..7e3cc32c9697bc5bf3b1d1527a6820e0b160cbad 100644
--- a/webkit/glue/multipart_response_delegate_unittest.cc
+++ b/webkit/glue/multipart_response_delegate_unittest.cc
@@ -603,4 +603,35 @@ TEST(MultipartResponseTest, MultipartContentRangesTest) {
EXPECT_EQ(result, false);
}
+TEST(MultipartResponseTest, MultipartPayloadSet) {
+ WebURLResponse response;
+ response.initialize();
+ response.setMIMEType(WebString::fromUTF8("multipart/x-mixed-replace"));
+ MockWebURLLoaderClient client;
+ MultipartResponseDelegate delegate(&client, NULL, response, "bound");
+
+ string data(
+ "--bound\n"
+ "Content-type: text/plain\n\n"
+ "response data\n"
+ "--bound\n");
+ delegate.OnReceivedData(data.c_str(), static_cast<int>(data.length()));
+ EXPECT_EQ(1,
+ client.received_response_);
+ EXPECT_EQ(string("response data\n"),
+ client.data_);
+ EXPECT_EQ(false, client.response_.isMultipartPayload());
+
+ string data2(
+ "Content-type: text/plain\n\n"
+ "response data2\n"
+ "--bound\n");
+ delegate.OnReceivedData(data2.c_str(), static_cast<int>(data2.length()));
+ EXPECT_EQ(2,
+ client.received_response_);
+ EXPECT_EQ(string("response data2\n"),
+ client.data_);
+ EXPECT_EQ(true, client.response_.isMultipartPayload());
+}
+
} // namespace
« no previous file with comments | « webkit/glue/multipart_response_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698