OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/multipart_response_delegate.h" |
| 6 |
5 #include <vector> | 7 #include <vector> |
6 | 8 |
7 #include "base/basictypes.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "third_party/WebKit/public/platform/WebString.h" | 10 #include "third_party/WebKit/public/platform/WebString.h" |
10 #include "third_party/WebKit/public/platform/WebURL.h" | 11 #include "third_party/WebKit/public/platform/WebURL.h" |
11 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 12 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
12 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 13 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
13 #include "webkit/child/multipart_response_delegate.h" | |
14 | 14 |
15 using std::string; | |
16 using blink::WebString; | 15 using blink::WebString; |
17 using blink::WebURL; | 16 using blink::WebURL; |
18 using blink::WebURLError; | 17 using blink::WebURLError; |
19 using blink::WebURLLoader; | 18 using blink::WebURLLoader; |
20 using blink::WebURLLoaderClient; | 19 using blink::WebURLLoaderClient; |
21 using blink::WebURLRequest; | 20 using blink::WebURLRequest; |
22 using blink::WebURLResponse; | 21 using blink::WebURLResponse; |
23 using content::MultipartResponseDelegateTester; | 22 using std::string; |
24 using webkit_glue::MultipartResponseDelegate; | |
25 | 23 |
26 namespace content { | 24 namespace content { |
27 | 25 |
28 class MultipartResponseDelegateTester { | 26 class MultipartResponseDelegateTester { |
29 public: | 27 public: |
30 MultipartResponseDelegateTester(MultipartResponseDelegate* delegate) | 28 MultipartResponseDelegateTester(MultipartResponseDelegate* delegate) |
31 : delegate_(delegate) { | 29 : delegate_(delegate) { |
32 } | 30 } |
33 | 31 |
34 int PushOverLine(const std::string& data, size_t pos) { | 32 int PushOverLine(const std::string& data, size_t pos) { |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 EXPECT_EQ(2, client.received_response_); | 665 EXPECT_EQ(2, client.received_response_); |
668 EXPECT_EQ(string("response data2"), client.data_); | 666 EXPECT_EQ(string("response data2"), client.data_); |
669 EXPECT_EQ(static_cast<int>(data.length()) + static_cast<int>(data2.length()), | 667 EXPECT_EQ(static_cast<int>(data.length()) + static_cast<int>(data2.length()), |
670 client.total_encoded_data_length_); | 668 client.total_encoded_data_length_); |
671 EXPECT_TRUE(client.response_.isMultipartPayload()); | 669 EXPECT_TRUE(client.response_.isMultipartPayload()); |
672 } | 670 } |
673 | 671 |
674 } // namespace | 672 } // namespace |
675 | 673 |
676 } // namespace content | 674 } // namespace content |
OLD | NEW |