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

Side by Side Diff: Source/platform/network/HTTPParsersTest.cpp

Issue 1018903002: Show deprecation warnings for header values in XHR according to RFC 7230 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/platform/network/HTTPParsers.cpp ('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 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 "config.h" 5 #include "config.h"
6 #include "HTTPParsers.h" 6 #include "HTTPParsers.h"
7 7
8 #include "wtf/MathExtras.h" 8 #include "wtf/MathExtras.h"
9 #include "wtf/text/AtomicString.h" 9 #include "wtf/text/AtomicString.h"
10 10
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 EXPECT_TRUE(set1.contains("whatever")); 232 EXPECT_TRUE(set1.contains("whatever"));
233 parseCommaDelimitedHeader("dprw\t , fo\to", set2); 233 parseCommaDelimitedHeader("dprw\t , fo\to", set2);
234 EXPECT_FALSE(set2.contains("dpr")); 234 EXPECT_FALSE(set2.contains("dpr"));
235 EXPECT_FALSE(set2.contains("rw")); 235 EXPECT_FALSE(set2.contains("rw"));
236 EXPECT_FALSE(set2.contains("whatever")); 236 EXPECT_FALSE(set2.contains("whatever"));
237 EXPECT_TRUE(set2.contains("dprw")); 237 EXPECT_TRUE(set2.contains("dprw"));
238 EXPECT_FALSE(set2.contains("foo")); 238 EXPECT_FALSE(set2.contains("foo"));
239 EXPECT_TRUE(set2.contains("fo\to")); 239 EXPECT_TRUE(set2.contains("fo\to"));
240 } 240 }
241 241
242 TEST(HTTPParsersTest, HTTPFieldContent)
243 {
244 EXPECT_TRUE(blink::isValidHTTPFieldContentRFC7230("\xd0\xa1"));
245 EXPECT_TRUE(blink::isValidHTTPFieldContentRFC7230("t t"));
246 EXPECT_TRUE(blink::isValidHTTPFieldContentRFC7230("t\tt"));
247 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(" "));
248 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(""));
249 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("\x7f"));
250 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\rt"));
251 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\nt"));
252 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\bt"));
253 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t\vt"));
hiroshige 2015/09/02 09:53:48 Could you add - a test for null bytes, e.g. EXPECT
254 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230(" t"));
255 EXPECT_FALSE(blink::isValidHTTPFieldContentRFC7230("t "));
256 }
257
242 } // namespace blink 258 } // namespace blink
243 259
OLDNEW
« no previous file with comments | « Source/platform/network/HTTPParsers.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698