Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: ui/gfx/text_elider_unittest.cc

Issue 23731010: Move text_elider to gfx. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update3 Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/text_elider.cc ('k') | ui/message_center/cocoa/notification_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/text/text_elider.h" 7 #include "ui/gfx/text_elider.h"
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "ui/gfx/font.h" 15 #include "ui/gfx/font.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 17
18 namespace ui { 18 namespace gfx {
19 19
20 namespace { 20 namespace {
21 21
22 struct Testcase { 22 struct Testcase {
23 const std::string input; 23 const std::string input;
24 const std::string output; 24 const std::string output;
25 }; 25 };
26 26
27 struct FileTestcase { 27 struct FileTestcase {
28 const base::FilePath::StringType input; 28 const base::FilePath::StringType input;
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 EXPECT_EQ(L"f\x2026", UTF16ToWide(TruncateString(string, 2))); 924 EXPECT_EQ(L"f\x2026", UTF16ToWide(TruncateString(string, 2)));
925 925
926 // Test adds ... at right spot when there is not enough room to break at a 926 // Test adds ... at right spot when there is not enough room to break at a
927 // word boundary. 927 // word boundary.
928 EXPECT_EQ(L"foooooey\x2026", UTF16ToWide(TruncateString(string, 11))); 928 EXPECT_EQ(L"foooooey\x2026", UTF16ToWide(TruncateString(string, 11)));
929 929
930 // Test completely truncates string if break is on initial whitespace. 930 // Test completely truncates string if break is on initial whitespace.
931 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(ASCIIToUTF16(" "), 2))); 931 EXPECT_EQ(L"\x2026", UTF16ToWide(TruncateString(ASCIIToUTF16(" "), 2)));
932 } 932 }
933 933
934 } // namespace ui 934 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/text_elider.cc ('k') | ui/message_center/cocoa/notification_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698