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

Unified Diff: ui/base/resource/resource_bundle_unittest.cc

Issue 19666006: Supports FontList in Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates ui_unittests_disabled for Android. Created 7 years, 5 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
Index: ui/base/resource/resource_bundle_unittest.cc
diff --git a/ui/base/resource/resource_bundle_unittest.cc b/ui/base/resource/resource_bundle_unittest.cc
index bbfc53324e2b689dadefb9f131f7e0ef90f68d43..0ec362b8d55b3e97564294883e1f4ac369c398ad 100644
--- a/ui/base/resource/resource_bundle_unittest.cc
+++ b/ui/base/resource/resource_bundle_unittest.cc
@@ -83,10 +83,11 @@ class MockResourceBundleDelegate : public ui::ResourceBundle::Delegate {
*value = GetLocalizedStringMock(message_id);
return true;
}
- MOCK_METHOD1(GetFontMock, gfx::Font*(ui::ResourceBundle::FontStyle style));
- virtual scoped_ptr<gfx::Font> GetFont(
+ MOCK_METHOD1(GetFontListMock,
+ gfx::FontList*(ui::ResourceBundle::FontStyle style));
+ virtual scoped_ptr<gfx::FontList> GetFontList(
ui::ResourceBundle::FontStyle style) OVERRIDE {
- return scoped_ptr<gfx::Font>(GetFontMock(style));
+ return scoped_ptr<gfx::FontList>(GetFontListMock(style));
}
};
@@ -307,16 +308,20 @@ TEST_F(ResourceBundleTest, DelegateGetLocalizedString) {
EXPECT_EQ(data, result);
}
-TEST_F(ResourceBundleTest, DelegateGetFont) {
+TEST_F(ResourceBundleTest, DelegateGetFontList) {
MockResourceBundleDelegate delegate;
ResourceBundle* resource_bundle = CreateResourceBundle(&delegate);
// Should be called once for each font type. When we return NULL the default
- // font will be created.
- gfx::Font* test_font = NULL;
- EXPECT_CALL(delegate, GetFontMock(_))
+ // font list will be created.
+ gfx::FontList* test_font_list = NULL;
+ EXPECT_CALL(delegate, GetFontListMock(_))
.Times(8)
- .WillRepeatedly(Return(test_font));
+ .WillRepeatedly(Return(test_font_list));
+
+ const gfx::FontList* font_list =
+ &resource_bundle->GetFontList(ui::ResourceBundle::BaseFont);
+ EXPECT_TRUE(font_list);
const gfx::Font* font =
&resource_bundle->GetFont(ui::ResourceBundle::BaseFont);

Powered by Google App Engine
This is Rietveld 408576698