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

Unified Diff: ui/message_center/views/bounded_label_unittest.cc

Issue 24084003: Clean-up: Replaces Font with FontList in ui/message_center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes comments at the ending of namespaces. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/views/bounded_label.cc ('k') | ui/message_center/views/notification_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/bounded_label_unittest.cc
diff --git a/ui/message_center/views/bounded_label_unittest.cc b/ui/message_center/views/bounded_label_unittest.cc
index a73d84bba9efad5351e4a3791f0331955a657c83..bdfb0aceeb63334b6172e900b2668acad66b8af3 100644
--- a/ui/message_center/views/bounded_label_unittest.cc
+++ b/ui/message_center/views/bounded_label_unittest.cc
@@ -10,7 +10,8 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/font.h"
+#include "ui/gfx/font_list.h"
+#include "ui/gfx/text_utils.h"
#include "ui/views/controls/label.h"
namespace message_center {
@@ -22,9 +23,10 @@ namespace test {
class BoundedLabelTest : public testing::Test {
public:
BoundedLabelTest() {
- digit_pixels_ = font_.GetStringWidth(UTF8ToUTF16("0"));
- space_pixels_ = font_.GetStringWidth(UTF8ToUTF16(" "));
- ellipsis_pixels_ = font_.GetStringWidth(UTF8ToUTF16("\xE2\x80\xA6"));
+ digit_pixels_ = gfx::GetStringWidth(UTF8ToUTF16("0"), font_list_);
+ space_pixels_ = gfx::GetStringWidth(UTF8ToUTF16(" "), font_list_);
+ ellipsis_pixels_ = gfx::GetStringWidth(UTF8ToUTF16("\xE2\x80\xA6"),
+ font_list_);
}
virtual ~BoundedLabelTest() {}
@@ -62,7 +64,7 @@ class BoundedLabelTest : public testing::Test {
// Exercise BounderLabel::GetLinesForWidthAndLimit() using the test label.
int GetLinesForWidth(int width) {
- label_->SetBounds(0, 0, width, font_.GetHeight() * lines_);
+ label_->SetBounds(0, 0, width, font_list_.GetHeight() * lines_);
return label_->GetLinesForWidthAndLimit(width, lines_);
}
@@ -71,13 +73,14 @@ class BoundedLabelTest : public testing::Test {
// test the newly created label using the exercise methods above.
BoundedLabelTest& Label(string16 text, int lines) {
lines_ = lines;
- label_.reset(new BoundedLabel(text, font_));
+ label_.reset(new BoundedLabel(text, font_list_));
label_->SetLineLimit(lines_);
return *this;
}
private:
- gfx::Font font_; // The default font, which will be used for tests.
+ // The default font list, which will be used for tests.
+ gfx::FontList font_list_;
int digit_pixels_;
int space_pixels_;
int ellipsis_pixels_;
« no previous file with comments | « ui/message_center/views/bounded_label.cc ('k') | ui/message_center/views/notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698