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

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

Issue 167393003: [Ozone] Disable TextUtils.GetStringWidth on Ozone (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | 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) 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 "ui/gfx/text_utils.h" 5 #include "ui/gfx/text_utils.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/font_list.h" 9 #include "ui/gfx/font_list.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 base::UTF8ToUTF16(cases[i].input), 53 base::UTF8ToUTF16(cases[i].input),
54 kAcceleratorChar, 54 kAcceleratorChar,
55 &accelerated_char_pos, 55 &accelerated_char_pos,
56 &accelerated_char_span); 56 &accelerated_char_span);
57 EXPECT_EQ(result, base::UTF8ToUTF16(cases[i].output)); 57 EXPECT_EQ(result, base::UTF8ToUTF16(cases[i].output));
58 EXPECT_EQ(accelerated_char_pos, cases[i].accelerated_char_pos); 58 EXPECT_EQ(accelerated_char_pos, cases[i].accelerated_char_pos);
59 EXPECT_EQ(accelerated_char_span, cases[i].accelerated_char_span); 59 EXPECT_EQ(accelerated_char_span, cases[i].accelerated_char_span);
60 } 60 }
61 } 61 }
62 62
63 TEST(TextUtilsTest, GetStringWidth) { 63 // Disabled on Ozone since there are no fonts: crbug.com/320050
64 #if defined(USE_OZONE)
65 #define MAYBE_GetStringWidth DISABLED_GetStringWidth
66 #else
67 #define MAYBE_GetStringWidth GetStringWidth
68 #endif
69 TEST(TextUtilsTest, MAYBE_GetStringWidth) {
64 FontList font_list; 70 FontList font_list;
65 EXPECT_EQ(GetStringWidth(base::string16(), font_list), 0); 71 EXPECT_EQ(GetStringWidth(base::string16(), font_list), 0);
66 EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("a"), font_list), 72 EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("a"), font_list),
67 GetStringWidth(base::string16(), font_list)); 73 GetStringWidth(base::string16(), font_list));
68 EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("ab"), font_list), 74 EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("ab"), font_list),
69 GetStringWidth(base::ASCIIToUTF16("a"), font_list)); 75 GetStringWidth(base::ASCIIToUTF16("a"), font_list));
70 EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("abc"), font_list), 76 EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("abc"), font_list),
71 GetStringWidth(base::ASCIIToUTF16("ab"), font_list)); 77 GetStringWidth(base::ASCIIToUTF16("ab"), font_list));
72 } 78 }
73 79
74 } // namespace 80 } // namespace
75 } // namespace gfx 81 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698