OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "net/base/escape.h" | 7 #include "net/base/escape.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | |
11 #include "base/string_util.h" | 10 #include "base/string_util.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 | 12 |
14 namespace { | 13 namespace { |
15 | 14 |
16 struct EscapeCase { | 15 struct EscapeCase { |
17 const wchar_t* input; | 16 const wchar_t* input; |
18 const wchar_t* output; | 17 const wchar_t* output; |
19 }; | 18 }; |
20 | 19 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 const EscapeForHTMLCase tests[] = { | 223 const EscapeForHTMLCase tests[] = { |
225 { "hello", "hello" }, | 224 { "hello", "hello" }, |
226 { "<hello>", "<hello>" }, | 225 { "<hello>", "<hello>" }, |
227 { "don\'t mess with me", "don't mess with me" }, | 226 { "don\'t mess with me", "don't mess with me" }, |
228 }; | 227 }; |
229 for (size_t i = 0; i < arraysize(tests); ++i) { | 228 for (size_t i = 0; i < arraysize(tests); ++i) { |
230 std::string result = EscapeForHTML(std::string(tests[i].input)); | 229 std::string result = EscapeForHTML(std::string(tests[i].input)); |
231 EXPECT_EQ(std::string(tests[i].expected_output), result); | 230 EXPECT_EQ(std::string(tests[i].expected_output), result); |
232 } | 231 } |
233 } | 232 } |
OLD | NEW |