OLD | NEW |
(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 |
OLD | NEW |