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

Side by Side Diff: third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp

Issue 1364993003: Add FetchUtils::normalizeHeaderValue( ) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « third_party/WebKit/Source/core/fetch/FetchUtils.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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/fetch/FetchUtils.h"
7
8 #include "wtf/text/WTFString.h"
9
10 #include <gtest/gtest.h>
11
12 namespace blink {
13
14 namespace {
15
16 TEST(FetchUtilsTest, NormalizeHeaderValue)
17 {
18 EXPECT_EQ("t", FetchUtils::normalizeHeaderValue(" t"));
19 EXPECT_EQ("t", FetchUtils::normalizeHeaderValue("t "));
20 EXPECT_EQ("t", FetchUtils::normalizeHeaderValue(" t "));
21 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\r"));
22 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\n"));
23 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\r\n"));
24 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\t"));
25 EXPECT_EQ("t t", FetchUtils::normalizeHeaderValue("t t"));
26 EXPECT_EQ("t\tt", FetchUtils::normalizeHeaderValue("t\tt"));
27 EXPECT_EQ("t\rt", FetchUtils::normalizeHeaderValue("t\rt"));
28 EXPECT_EQ("t\nt", FetchUtils::normalizeHeaderValue("t\nt"));
29 EXPECT_EQ("t\r\nt", FetchUtils::normalizeHeaderValue("t\r\nt"));
30 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\rtest"));
31 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\ntest"));
32 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\r\ntest"));
33 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\ttest"));
34 EXPECT_EQ("", FetchUtils::normalizeHeaderValue(""));
35 EXPECT_EQ("", FetchUtils::normalizeHeaderValue(" "));
36 EXPECT_EQ("", FetchUtils::normalizeHeaderValue("\r\n\r\n\r\n"));
37 EXPECT_EQ("\xd0\xa1", FetchUtils::normalizeHeaderValue("\xd0\xa1"));
38 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test"));
39 }
40
41 } // namespace
42
43 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698