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> | 9 #include <stddef.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/message_loop/message_loop.h" |
17 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
18 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "ui/gfx/font.h" | 23 #include "ui/gfx/font.h" |
23 #include "ui/gfx/font_list.h" | 24 #include "ui/gfx/font_list.h" |
24 #include "ui/gfx/font_render_params.h" | 25 #include "ui/gfx/font_render_params.h" |
25 #include "ui/gfx/text_utils.h" | 26 #include "ui/gfx/text_utils.h" |
26 | 27 |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 | 1143 |
1143 // Test breaking in the middle of the first word, with leading whitespace. | 1144 // Test breaking in the middle of the first word, with leading whitespace. |
1144 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, WORD_BREAK))); | 1145 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, WORD_BREAK))); |
1145 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, CHARACTER_BREAK))); | 1146 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, CHARACTER_BREAK))); |
1146 EXPECT_EQ(L" f\x2026", UTF16ToWide(TruncateString(str2, 5, WORD_BREAK))); | 1147 EXPECT_EQ(L" f\x2026", UTF16ToWide(TruncateString(str2, 5, WORD_BREAK))); |
1147 EXPECT_EQ(L" f\x2026", | 1148 EXPECT_EQ(L" f\x2026", |
1148 UTF16ToWide(TruncateString(str2, 5, CHARACTER_BREAK))); | 1149 UTF16ToWide(TruncateString(str2, 5, CHARACTER_BREAK))); |
1149 } | 1150 } |
1150 | 1151 |
1151 } // namespace gfx | 1152 } // namespace gfx |
OLD | NEW |