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 "base/json/string_escape.h" | 5 #include "base/json/string_escape.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace base { | 9 namespace base { |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 const struct json_narrow_test_data { | 13 const struct json_narrow_test_data { |
14 const char* to_escape; | 14 const char* to_escape; |
15 const char* escaped; | 15 const char* escaped; |
16 } json_narrow_cases[] = { | 16 } json_narrow_cases[] = { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 null_prepend.push_back(0); | 91 null_prepend.push_back(0); |
92 in = null_prepend + in; | 92 in = null_prepend + in; |
93 std::string expected = "test\\u0000"; | 93 std::string expected = "test\\u0000"; |
94 expected += json_wide_cases[0].escaped; | 94 expected += json_wide_cases[0].escaped; |
95 out.clear(); | 95 out.clear(); |
96 JsonDoubleQuote(in, false, &out); | 96 JsonDoubleQuote(in, false, &out); |
97 EXPECT_EQ(expected, out); | 97 EXPECT_EQ(expected, out); |
98 } | 98 } |
99 | 99 |
100 } // namespace base | 100 } // namespace base |
OLD | NEW |