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

Side by Side Diff: content/renderer/npapi/webplugin_impl_unittest.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/npapi/plugin_host.cc ('k') | content/renderer/p2p/port_allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/npapi/webplugin_impl.h" 6 #include "content/renderer/npapi/webplugin_impl.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "third_party/WebKit/public/platform/WebCString.h" 8 #include "third_party/WebKit/public/platform/WebCString.h"
9 #include "third_party/WebKit/public/platform/WebString.h" 9 #include "third_party/WebKit/public/platform/WebString.h"
10 #include "third_party/WebKit/public/platform/WebURLRequest.h" 10 #include "third_party/WebKit/public/platform/WebURLRequest.h"
11 11
12 using blink::WebHTTPBody; 12 using blink::WebHTTPBody;
13 using blink::WebString; 13 using blink::WebString;
14 using blink::WebURLRequest; 14 using blink::WebURLRequest;
15 15
16 namespace content { 16 namespace content {
17 17
18 namespace { 18 namespace {
19 19
20 std::string GetHeader(const WebURLRequest& request, const char* name) { 20 std::string GetHeader(const WebURLRequest& request, const char* name) {
21 std::string result; 21 std::string result;
22 TrimWhitespace( 22 base::TrimWhitespace(
23 request.httpHeaderField(WebString::fromUTF8(name)).utf8(), 23 request.httpHeaderField(WebString::fromUTF8(name)).utf8(),
24 TRIM_ALL, 24 base::TRIM_ALL,
25 &result); 25 &result);
26 return result; 26 return result;
27 } 27 }
28 28
29 std::string GetBodyText(const WebURLRequest& request) { 29 std::string GetBodyText(const WebURLRequest& request) {
30 const WebHTTPBody& body = request.httpBody(); 30 const WebHTTPBody& body = request.httpBody();
31 if (body.isNull()) 31 if (body.isNull())
32 return std::string(); 32 return std::string();
33 33
34 std::string result; 34 std::string result;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 std::string body = GetBodyText(request); 224 std::string body = GetBodyText(request);
225 225
226 EXPECT_EQ(0xF0, (unsigned char)body[0]); 226 EXPECT_EQ(0xF0, (unsigned char)body[0]);
227 EXPECT_EQ(0xFF, (unsigned char)body[1]); 227 EXPECT_EQ(0xFF, (unsigned char)body[1]);
228 EXPECT_EQ(0xFF, (unsigned char)body[2]); 228 EXPECT_EQ(0xFF, (unsigned char)body[2]);
229 EXPECT_EQ(0xFF, (unsigned char)body[3]); 229 EXPECT_EQ(0xFF, (unsigned char)body[3]);
230 } 230 }
231 231
232 } // namespace content 232 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/plugin_host.cc ('k') | content/renderer/p2p/port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698