OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Unit tests for eliding and formatting utility functions. | 5 // Unit tests for eliding and formatting utility functions. |
6 | 6 |
7 #include "ui/gfx/text_elider.h" | 7 #include "ui/gfx/text_elider.h" |
8 | 8 |
| 9 #include <stddef.h> |
| 10 |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
12 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
14 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "build/build_config.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "ui/gfx/font.h" | 21 #include "ui/gfx/font.h" |
18 #include "ui/gfx/font_list.h" | 22 #include "ui/gfx/font_list.h" |
19 #include "ui/gfx/font_render_params.h" | 23 #include "ui/gfx/font_render_params.h" |
20 #include "ui/gfx/text_utils.h" | 24 #include "ui/gfx/text_utils.h" |
21 | 25 |
22 using base::ASCIIToUTF16; | 26 using base::ASCIIToUTF16; |
23 using base::UTF16ToUTF8; | 27 using base::UTF16ToUTF8; |
24 using base::UTF16ToWide; | 28 using base::UTF16ToWide; |
25 using base::UTF8ToUTF16; | 29 using base::UTF8ToUTF16; |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 | 1137 |
1134 // Test breaking in the middle of the first word, with leading whitespace. | 1138 // Test breaking in the middle of the first word, with leading whitespace. |
1135 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, WORD_BREAK))); | 1139 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, WORD_BREAK))); |
1136 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, CHARACTER_BREAK))); | 1140 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, CHARACTER_BREAK))); |
1137 EXPECT_EQ(L" f\x2026", UTF16ToWide(TruncateString(str2, 5, WORD_BREAK))); | 1141 EXPECT_EQ(L" f\x2026", UTF16ToWide(TruncateString(str2, 5, WORD_BREAK))); |
1138 EXPECT_EQ(L" f\x2026", | 1142 EXPECT_EQ(L" f\x2026", |
1139 UTF16ToWide(TruncateString(str2, 5, CHARACTER_BREAK))); | 1143 UTF16ToWide(TruncateString(str2, 5, CHARACTER_BREAK))); |
1140 } | 1144 } |
1141 | 1145 |
1142 } // namespace gfx | 1146 } // namespace gfx |
OLD | NEW |