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 <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "ui/gfx/font.h" | 21 #include "ui/gfx/font.h" |
22 #include "ui/gfx/font_list.h" | 22 #include "ui/gfx/font_list.h" |
23 #include "ui/gfx/font_render_params.h" | 23 #include "ui/gfx/font_render_params.h" |
24 #include "ui/gfx/text_utils.h" | 24 #include "ui/gfx/text_utils.h" |
25 | 25 |
26 using base::ASCIIToUTF16; | 26 using base::ASCIIToUTF16; |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 | 1137 |
1138 // 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. |
1139 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, WORD_BREAK))); | 1139 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, WORD_BREAK))); |
1140 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, CHARACTER_BREAK))); | 1140 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(str2, 4, CHARACTER_BREAK))); |
1141 EXPECT_EQ(L" f\x2026", UTF16ToWide(TruncateString(str2, 5, WORD_BREAK))); | 1141 EXPECT_EQ(L" f\x2026", UTF16ToWide(TruncateString(str2, 5, WORD_BREAK))); |
1142 EXPECT_EQ(L" f\x2026", | 1142 EXPECT_EQ(L" f\x2026", |
1143 UTF16ToWide(TruncateString(str2, 5, CHARACTER_BREAK))); | 1143 UTF16ToWide(TruncateString(str2, 5, CHARACTER_BREAK))); |
1144 } | 1144 } |
1145 | 1145 |
1146 } // namespace gfx | 1146 } // namespace gfx |
OLD | NEW |