| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/message_center/views/bounded_label.h" | 5 #include "ui/message_center/views/bounded_label.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "ui/gfx/font_list.h" | 12 #include "ui/gfx/font_list.h" |
| 13 #include "ui/gfx/text_utils.h" | 13 #include "ui/gfx/text_utils.h" |
| 14 #include "ui/views/controls/label.h" | 14 #include "ui/views/controls/label.h" |
| 15 #include "ui/views/test/views_test_base.h" |
| 15 | 16 |
| 16 namespace message_center { | 17 namespace message_center { |
| 17 | 18 |
| 18 namespace test { | 19 namespace test { |
| 19 | 20 |
| 20 /* Test fixture ***************************************************************/ | 21 /* Test fixture ***************************************************************/ |
| 21 | 22 |
| 22 class BoundedLabelTest : public testing::Test { | 23 class BoundedLabelTest : public views::ViewsTestBase { |
| 23 public: | 24 public: |
| 24 BoundedLabelTest() { | 25 BoundedLabelTest() { |
| 25 digit_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("0"), font_list_); | 26 digit_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("0"), font_list_); |
| 26 space_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16(" "), font_list_); | 27 space_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16(" "), font_list_); |
| 27 ellipsis_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("\xE2\x80\xA6"), | 28 ellipsis_pixels_ = gfx::GetStringWidth(base::UTF8ToUTF16("\xE2\x80\xA6"), |
| 28 font_list_); | 29 font_list_); |
| 29 } | 30 } |
| 30 | 31 |
| 31 ~BoundedLabelTest() override {} | 32 ~BoundedLabelTest() override {} |
| 32 | 33 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 210 |
| 210 // TODO(dharcourt): Add test cases to verify that: | 211 // TODO(dharcourt): Add test cases to verify that: |
| 211 // - SetMaxLines() affects the return values of some methods but not others. | 212 // - SetMaxLines() affects the return values of some methods but not others. |
| 212 // - Bound changes affects GetPreferredLines(), GetTextSize(), and | 213 // - Bound changes affects GetPreferredLines(), GetTextSize(), and |
| 213 // GetWrappedText() return values. | 214 // GetWrappedText() return values. |
| 214 // - GetTextFlags are as expected. | 215 // - GetTextFlags are as expected. |
| 215 | 216 |
| 216 } // namespace test | 217 } // namespace test |
| 217 | 218 |
| 218 } // namespace message_center | 219 } // namespace message_center |
| OLD | NEW |