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

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 #ifndef FetchUtilsTest_h
6 #define FetchUtilsTest_h
tyoshino (SeeGerritForStatus) 2015/09/24 09:24:02 oh, I didn't catch this. remove the include guard
shiva.jm 2015/09/24 09:41:38 actually, its added in few test files, majority te
tyoshino (SeeGerritForStatus) 2015/09/28 06:03:37 I've cleaned up the test files. Thank for the info
7
8 #include "config.h"
9 #include "core/fetch/FetchUtils.h"
10
11 #include "wtf/text/AtomicString.h"
tyoshino (SeeGerritForStatus) 2015/09/24 09:26:57 is this necessary?
shiva.jm 2015/09/24 09:41:38 yes, its needed, otherwise will get compile error.
tyoshino (SeeGerritForStatus) 2015/09/28 06:02:09 How about wtf/text/WTFString.h? It's indirectly in
12
13 #include <gtest/gtest.h>
14
15 namespace blink {
16
17 namespace {
18
19 TEST(FetchUtilsTest, NormalizeHeaderValue)
20 {
21 EXPECT_EQ("t", FetchUtils::normalizeHeaderValue(" t"));
22 EXPECT_EQ("t", FetchUtils::normalizeHeaderValue("t "));
23 EXPECT_EQ("t", FetchUtils::normalizeHeaderValue(" t "));
24 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\r"));
25 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\n"));
26 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\r\n"));
27 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\t"));
28 EXPECT_EQ("t t", FetchUtils::normalizeHeaderValue("t t"));
29 EXPECT_EQ("t\tt", FetchUtils::normalizeHeaderValue("t\tt"));
30 EXPECT_EQ("t\rt", FetchUtils::normalizeHeaderValue("t\rt"));
31 EXPECT_EQ("t\nt", FetchUtils::normalizeHeaderValue("t\nt"));
32 EXPECT_EQ("t\r\nt", FetchUtils::normalizeHeaderValue("t\r\nt"));
33 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\rtest"));
34 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\ntest"));
35 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\r\ntest"));
36 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\ttest"));
37 EXPECT_EQ("", FetchUtils::normalizeHeaderValue(""));
38 EXPECT_EQ("", FetchUtils::normalizeHeaderValue(" "));
39 EXPECT_EQ("", FetchUtils::normalizeHeaderValue("\r\n\r\n\r\n"));
40 EXPECT_EQ("\xd0\xa1", FetchUtils::normalizeHeaderValue("\xd0\xa1"));
41 EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test"));
42 }
43
44 } // namespace
45
46 } // namespace blink
47
48 #endif // FetchUtilsTest_h
tyoshino (SeeGerritForStatus) 2015/09/24 09:24:02 here too
shiva.jm 2015/09/24 09:41:38 Done.
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