OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/basictypes.h" | 5 #include <stddef.h> |
| 6 |
6 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" |
7 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
8 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "build/build_config.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
11 | 14 |
12 namespace base { | 15 namespace base { |
13 | 16 |
14 namespace { | 17 namespace { |
15 | 18 |
16 const wchar_t* const kConvertRoundtripCases[] = { | 19 const wchar_t* const kConvertRoundtripCases[] = { |
17 L"Google Video", | 20 L"Google Video", |
18 // "网页 图片 资讯更多 »" | 21 // "网页 图片 资讯更多 »" |
19 L"\x7f51\x9875\x0020\x56fe\x7247\x0020\x8d44\x8baf\x66f4\x591a\x0020\x00bb", | 22 L"\x7f51\x9875\x0020\x56fe\x7247\x0020\x8d44\x8baf\x66f4\x591a\x0020\x00bb", |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 EXPECT_EQ(arraysize(multi16) - 1, multistring16.length()); | 202 EXPECT_EQ(arraysize(multi16) - 1, multistring16.length()); |
200 std::string expected; | 203 std::string expected; |
201 memcpy(WriteInto(&expected, arraysize(multi)), multi, sizeof(multi)); | 204 memcpy(WriteInto(&expected, arraysize(multi)), multi, sizeof(multi)); |
202 EXPECT_EQ(arraysize(multi) - 1, expected.length()); | 205 EXPECT_EQ(arraysize(multi) - 1, expected.length()); |
203 const std::string& converted = UTF16ToUTF8(multistring16); | 206 const std::string& converted = UTF16ToUTF8(multistring16); |
204 EXPECT_EQ(arraysize(multi) - 1, converted.length()); | 207 EXPECT_EQ(arraysize(multi) - 1, converted.length()); |
205 EXPECT_EQ(expected, converted); | 208 EXPECT_EQ(expected, converted); |
206 } | 209 } |
207 | 210 |
208 } // namespace base | 211 } // namespace base |
OLD | NEW |