Index: third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp b/third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b212832e38a3f03a5d3d59b66ce658e457cf0db3 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/fetch/FetchUtilsTest.cpp |
@@ -0,0 +1,48 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef FetchUtilsTest_h |
+#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
|
+ |
+#include "config.h" |
+#include "core/fetch/FetchUtils.h" |
+ |
+#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
|
+ |
+#include <gtest/gtest.h> |
+ |
+namespace blink { |
+ |
+namespace { |
+ |
+TEST(FetchUtilsTest, NormalizeHeaderValue) |
+{ |
+ EXPECT_EQ("t", FetchUtils::normalizeHeaderValue(" t")); |
+ EXPECT_EQ("t", FetchUtils::normalizeHeaderValue("t ")); |
+ EXPECT_EQ("t", FetchUtils::normalizeHeaderValue(" t ")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\r")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\n")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\r\n")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test\t")); |
+ EXPECT_EQ("t t", FetchUtils::normalizeHeaderValue("t t")); |
+ EXPECT_EQ("t\tt", FetchUtils::normalizeHeaderValue("t\tt")); |
+ EXPECT_EQ("t\rt", FetchUtils::normalizeHeaderValue("t\rt")); |
+ EXPECT_EQ("t\nt", FetchUtils::normalizeHeaderValue("t\nt")); |
+ EXPECT_EQ("t\r\nt", FetchUtils::normalizeHeaderValue("t\r\nt")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\rtest")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\ntest")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\r\ntest")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("\ttest")); |
+ EXPECT_EQ("", FetchUtils::normalizeHeaderValue("")); |
+ EXPECT_EQ("", FetchUtils::normalizeHeaderValue(" ")); |
+ EXPECT_EQ("", FetchUtils::normalizeHeaderValue("\r\n\r\n\r\n")); |
+ EXPECT_EQ("\xd0\xa1", FetchUtils::normalizeHeaderValue("\xd0\xa1")); |
+ EXPECT_EQ("test", FetchUtils::normalizeHeaderValue("test")); |
+} |
+ |
+} // namespace |
+ |
+} // namespace blink |
+ |
+#endif // FetchUtilsTest_h |
tyoshino (SeeGerritForStatus)
2015/09/24 09:24:02
here too
shiva.jm
2015/09/24 09:41:38
Done.
|