OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/strings/string_util.h" | 5 #include "base/strings/string_util.h" |
| 6 #include "content/renderer/webplugin_impl.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
7 #include "third_party/WebKit/public/platform/WebCString.h" | 8 #include "third_party/WebKit/public/platform/WebCString.h" |
8 #include "third_party/WebKit/public/platform/WebString.h" | 9 #include "third_party/WebKit/public/platform/WebString.h" |
9 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 10 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
10 #include "webkit/plugins/npapi/webplugin_impl.h" | |
11 | 11 |
12 using WebKit::WebHTTPBody; | 12 using WebKit::WebHTTPBody; |
13 using WebKit::WebString; | 13 using WebKit::WebString; |
14 using WebKit::WebURLRequest; | 14 using WebKit::WebURLRequest; |
15 | 15 |
16 namespace webkit { | 16 namespace content { |
17 namespace npapi { | |
18 | 17 |
19 namespace { | 18 namespace { |
20 | 19 |
21 std::string GetHeader(const WebURLRequest& request, const char* name) { | 20 std::string GetHeader(const WebURLRequest& request, const char* name) { |
22 std::string result; | 21 std::string result; |
23 TrimWhitespace( | 22 TrimWhitespace( |
24 request.httpHeaderField(WebString::fromUTF8(name)).utf8(), | 23 request.httpHeaderField(WebString::fromUTF8(name)).utf8(), |
25 TRIM_ALL, | 24 TRIM_ALL, |
26 &result); | 25 &result); |
27 return result; | 26 return result; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 EXPECT_EQ(0U, GetHeader(request, "Content-length").length()); | 222 EXPECT_EQ(0U, GetHeader(request, "Content-length").length()); |
224 | 223 |
225 std::string body = GetBodyText(request); | 224 std::string body = GetBodyText(request); |
226 | 225 |
227 EXPECT_EQ(0xF0, (unsigned char)body[0]); | 226 EXPECT_EQ(0xF0, (unsigned char)body[0]); |
228 EXPECT_EQ(0xFF, (unsigned char)body[1]); | 227 EXPECT_EQ(0xFF, (unsigned char)body[1]); |
229 EXPECT_EQ(0xFF, (unsigned char)body[2]); | 228 EXPECT_EQ(0xFF, (unsigned char)body[2]); |
230 EXPECT_EQ(0xFF, (unsigned char)body[3]); | 229 EXPECT_EQ(0xFF, (unsigned char)body[3]); |
231 } | 230 } |
232 | 231 |
233 } // namespace npapi | 232 } // namespace content |
234 } // namespace webkit | |
OLD | NEW |