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