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

Side by Side Diff: webkit/glue/webplugin_impl_unittest.cc

Issue 165297: Replaces some TrimWhitespace with TrimWhitespaceASCII or TrimWhitespaceUTF8.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: hunspell fix Created 11 years, 4 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 | « webkit/glue/plugins/plugin_host.cc ('k') | no next file » | 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) 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 "config.h" 5 #include "config.h"
6 6
7 // Avoid collisions with the LOG macro 7 // Avoid collisions with the LOG macro
8 #include <wtf/Assertions.h> 8 #include <wtf/Assertions.h>
9 #undef LOG 9 #undef LOG
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 // These exist only to support the gTest assertion macros, and 29 // These exist only to support the gTest assertion macros, and
30 // shouldn't be used in normal program code. 30 // shouldn't be used in normal program code.
31 std::ostream& operator<<(std::ostream& out, const WebCore::String& str) 31 std::ostream& operator<<(std::ostream& out, const WebCore::String& str)
32 { 32 {
33 return out << str.latin1().data(); 33 return out << str.latin1().data();
34 } 34 }
35 35
36 static std::string GetHeader(const WebURLRequest& request, const char* name) { 36 static std::string GetHeader(const WebURLRequest& request, const char* name) {
37 std::string result; 37 std::string result;
38 TrimWhitespace( 38 TrimWhitespaceASCII(
39 webkit_glue::WebStringToStdString( 39 webkit_glue::WebStringToStdString(
40 request.httpHeaderField(WebString::fromUTF8(name))), 40 request.httpHeaderField(WebString::fromUTF8(name))),
41 TRIM_ALL, 41 TRIM_ALL,
42 &result); 42 &result);
43 return result; 43 return result;
44 } 44 }
45 45
46 static std::string GetBodyText(const WebURLRequest& request) { 46 static std::string GetBodyText(const WebURLRequest& request) {
47 const WebHTTPBody& body = request.httpBody(); 47 const WebHTTPBody& body = request.httpBody();
48 if (body.isNull()) 48 if (body.isNull())
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 EXPECT_EQ(0U, GetHeader(request, "bar").length()); 236 EXPECT_EQ(0U, GetHeader(request, "bar").length());
237 EXPECT_EQ(0U, GetHeader(request, "Content-length").length()); 237 EXPECT_EQ(0U, GetHeader(request, "Content-length").length());
238 238
239 std::string body = GetBodyText(request); 239 std::string body = GetBodyText(request);
240 240
241 EXPECT_EQ(0xF0, (unsigned char)body[0]); 241 EXPECT_EQ(0xF0, (unsigned char)body[0]);
242 EXPECT_EQ(0xFF, (unsigned char)body[1]); 242 EXPECT_EQ(0xFF, (unsigned char)body[1]);
243 EXPECT_EQ(0xFF, (unsigned char)body[2]); 243 EXPECT_EQ(0xFF, (unsigned char)body[2]);
244 EXPECT_EQ(0xFF, (unsigned char)body[3]); 244 EXPECT_EQ(0xFF, (unsigned char)body[3]);
245 } 245 }
OLDNEW
« no previous file with comments | « webkit/glue/plugins/plugin_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698