OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/text_elider.h" | |
6 #include "base/file_path.h" | 5 #include "base/file_path.h" |
7 #include "base/i18n/rtl.h" | 6 #include "base/i18n/rtl.h" |
8 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 8 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
11 #include "gfx/font.h" | 10 #include "gfx/font.h" |
12 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "ui/base/text/text_elider.h" |
| 14 |
| 15 namespace ui { |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 const wchar_t kEllipsis[] = L"\x2026"; | 19 const wchar_t kEllipsis[] = L"\x2026"; |
18 | 20 |
19 struct Testcase { | 21 struct Testcase { |
20 const std::string input; | 22 const std::string input; |
21 const std::wstring output; | 23 const std::wstring output; |
22 }; | 24 }; |
23 | 25 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 "\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C" | 432 "\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C" |
431 " aaaaa")); | 433 " aaaaa")); |
432 const string16 out(UTF8ToUTF16( | 434 const string16 out(UTF8ToUTF16( |
433 "\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\n" | 435 "\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\n" |
434 "\xF0\x9D\x92\x9C \naaa\n...")); | 436 "\xF0\x9D\x92\x9C \naaa\n...")); |
435 string16 output; | 437 string16 output; |
436 EXPECT_TRUE(gfx::ElideRectangleString(str, 3, 3, &output)); | 438 EXPECT_TRUE(gfx::ElideRectangleString(str, 3, 3, &output)); |
437 EXPECT_EQ(out, output); | 439 EXPECT_EQ(out, output); |
438 } | 440 } |
439 | 441 |
| 442 } // namespace ui |
OLD | NEW |