summaryrefslogtreecommitdiffstats
path: root/webkit/glue/multipart_response_delegate_unittest.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 02:28:36 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 02:28:36 +0000
commitbeac9998f6cb2de039fa6d49f241ce4e924f05f4 (patch)
treea7977f3ce9bc982ec4287bc4998ba484af68b3d7 /webkit/glue/multipart_response_delegate_unittest.cc
parentfebe7e1c89d096517f416721f6f98617b30d238c (diff)
downloadchromium_src-beac9998f6cb2de039fa6d49f241ce4e924f05f4.zip
chromium_src-beac9998f6cb2de039fa6d49f241ce4e924f05f4.tar.gz
chromium_src-beac9998f6cb2de039fa6d49f241ce4e924f05f4.tar.bz2
Fix PDF files not loading at times with Acrobat Reader. This only happens in the FastWebView code path while handling
byte range requests. We need to strip out trailing \n\r characters before the boundary marker on the same lines as Firefox. Updated the multipart tests to account for this. Fixes bug http://code.google.com/p/chromium/issues/detail?id=48580 Bug=48580 Review URL: http://codereview.chromium.org/2881017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/multipart_response_delegate_unittest.cc')
-rw-r--r--webkit/glue/multipart_response_delegate_unittest.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/webkit/glue/multipart_response_delegate_unittest.cc b/webkit/glue/multipart_response_delegate_unittest.cc
index 84d1e05..0433b52 100644
--- a/webkit/glue/multipart_response_delegate_unittest.cc
+++ b/webkit/glue/multipart_response_delegate_unittest.cc
@@ -221,7 +221,7 @@ TEST(MultipartResponseTest, MissingBoundaries) {
static_cast<int>(no_start_boundary.length()));
EXPECT_EQ(1, client.received_response_);
EXPECT_EQ(1, client.received_data_);
- EXPECT_EQ(string("This is a sample response\n"),
+ EXPECT_EQ(string("This is a sample response"),
client.data_);
delegate.OnCompletedRequest();
@@ -287,7 +287,7 @@ TEST(MultipartResponseTest, MalformedBoundary) {
delegate.OnReceivedData(data.c_str(), static_cast<int>(data.length()));
EXPECT_EQ(1, client.received_response_);
EXPECT_EQ(1, client.received_data_);
- EXPECT_EQ(string("This is a sample response\n"), client.data_);
+ EXPECT_EQ(string("This is a sample response"), client.data_);
delegate.OnCompletedRequest();
EXPECT_EQ(1, client.received_response_);
@@ -304,8 +304,9 @@ struct TestChunk {
const char* expected_data;
};
-void VariousChunkSizesTest(const TestChunk chunks[], int chunks_size, int responses,
- int received_data, const char* completed_data) {
+void VariousChunkSizesTest(const TestChunk chunks[], int chunks_size,
+ int responses, int received_data,
+ const char* completed_data) {
const string data(
"--bound\n" // 0-7
"Content-type: image/png\n\n" // 8-32
@@ -618,7 +619,7 @@ TEST(MultipartResponseTest, MultipartPayloadSet) {
delegate.OnReceivedData(data.c_str(), static_cast<int>(data.length()));
EXPECT_EQ(1,
client.received_response_);
- EXPECT_EQ(string("response data\n"),
+ EXPECT_EQ(string("response data"),
client.data_);
EXPECT_EQ(false, client.response_.isMultipartPayload());
@@ -629,7 +630,7 @@ TEST(MultipartResponseTest, MultipartPayloadSet) {
delegate.OnReceivedData(data2.c_str(), static_cast<int>(data2.length()));
EXPECT_EQ(2,
client.received_response_);
- EXPECT_EQ(string("response data2\n"),
+ EXPECT_EQ(string("response data2"),
client.data_);
EXPECT_EQ(true, client.response_.isMultipartPayload());
}