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

Unified Diff: ui/gfx/text_utils_unittest.cc

Issue 138013004: Clean-up: Renames gfx::Font's methods and removes its obsolete methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unused methods in PlatformFont. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/text_utils_unittest.cc
diff --git a/ui/gfx/text_utils_unittest.cc b/ui/gfx/text_utils_unittest.cc
index 74c3ad4dc8f17844f5d934bfd3ff0ad25d1c92fb..bc4953fbd583733a8543f5f37c3c37cd74cd1e18 100644
--- a/ui/gfx/text_utils_unittest.cc
+++ b/ui/gfx/text_utils_unittest.cc
@@ -6,6 +6,7 @@
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/font_list.h"
namespace gfx {
namespace {
@@ -59,5 +60,16 @@ TEST(TextUtilsTest, RemoveAcceleratorChar) {
}
}
+TEST(TextUtilsTest, GetStringWidth) {
+ FontList font_list;
+ EXPECT_EQ(GetStringWidth(base::string16(), font_list), 0);
+ EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("a"), font_list),
+ GetStringWidth(base::string16(), font_list));
+ EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("ab"), font_list),
+ GetStringWidth(base::ASCIIToUTF16("a"), font_list));
+ EXPECT_GT(GetStringWidth(base::ASCIIToUTF16("abc"), font_list),
+ GetStringWidth(base::ASCIIToUTF16("ab"), font_list));
+}
+
} // namespace
} // namespace gfx
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698