| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "config.h" | 7 #include "config.h" |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 String("Thu, 11 Sep 2008 18:21:42 GMT")); | 418 String("Thu, 11 Sep 2008 18:21:42 GMT")); |
| 419 response3.setHTTPHeaderField( | 419 response3.setHTTPHeaderField( |
| 420 String("Content-type"), | 420 String("Content-type"), |
| 421 String("multipart/byteranges")); | 421 String("multipart/byteranges")); |
| 422 | 422 |
| 423 multipart_boundary.clear(); | 423 multipart_boundary.clear(); |
| 424 result = MultipartResponseDelegate::ReadMultipartBoundary( | 424 result = MultipartResponseDelegate::ReadMultipartBoundary( |
| 425 response3, &multipart_boundary); | 425 response3, &multipart_boundary); |
| 426 EXPECT_EQ(result, false); | 426 EXPECT_EQ(result, false); |
| 427 EXPECT_EQ(multipart_boundary.length(), 0U); | 427 EXPECT_EQ(multipart_boundary.length(), 0U); |
| 428 |
| 429 ResourceResponse response4(KURL(), "multipart/byteranges", 0, "en-US", |
| 430 String()); |
| 431 response4.setHTTPHeaderField(String("Content-Length"), String("200")); |
| 432 response4.setHTTPHeaderField( |
| 433 String("Content-type"), |
| 434 String("multipart/byteranges; boundary=--bound--; charSet=utf8")); |
| 435 |
| 436 multipart_boundary.clear(); |
| 437 |
| 438 result = MultipartResponseDelegate::ReadMultipartBoundary( |
| 439 response4, &multipart_boundary); |
| 440 EXPECT_EQ(result, true); |
| 441 EXPECT_EQ(string("--bound--"), multipart_boundary); |
| 428 } | 442 } |
| 429 | 443 |
| 430 TEST(MultipartResponseTest, MultipartContentRangesTest) { | 444 TEST(MultipartResponseTest, MultipartContentRangesTest) { |
| 431 ResourceResponse response1(KURL(), "application/pdf", 0, "en-US", | 445 ResourceResponse response1(KURL(), "application/pdf", 0, "en-US", |
| 432 String()); | 446 String()); |
| 433 response1.setHTTPHeaderField(String("Content-Length"), String("200")); | 447 response1.setHTTPHeaderField(String("Content-Length"), String("200")); |
| 434 response1.setHTTPHeaderField( | 448 response1.setHTTPHeaderField( |
| 435 String("Content-Range"), | 449 String("Content-Range"), |
| 436 String("bytes 1000-1050/5000")); | 450 String("bytes 1000-1050/5000")); |
| 437 | 451 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 458 | 472 |
| 459 result = MultipartResponseDelegate::ReadContentRanges( | 473 result = MultipartResponseDelegate::ReadContentRanges( |
| 460 response2, &content_range_lower_bound, | 474 response2, &content_range_lower_bound, |
| 461 &content_range_upper_bound); | 475 &content_range_upper_bound); |
| 462 | 476 |
| 463 EXPECT_EQ(result, false); | 477 EXPECT_EQ(result, false); |
| 464 } | 478 } |
| 465 | 479 |
| 466 } // namespace | 480 } // namespace |
| 467 | 481 |
| OLD | NEW |