| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/controls/label.h" |
| 6 |
| 5 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/base/accessibility/accessible_view_state.h" | 10 #include "ui/base/accessibility/accessible_view_state.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 11 #include "ui/views/border.h" | 13 #include "ui/views/border.h" |
| 12 #include "ui/views/controls/label.h" | |
| 13 | 14 |
| 14 namespace views { | 15 namespace views { |
| 15 | 16 |
| 16 // All text sizing measurements (width and height) should be greater than this. | 17 // All text sizing measurements (width and height) should be greater than this. |
| 17 const int kMinTextDimension = 4; | 18 const int kMinTextDimension = 4; |
| 18 | 19 |
| 19 // Disabled. http://crbug.com/316955 | 20 TEST(LabelTest, FontPropertySymbol) { |
| 20 TEST(LabelTest, DISABLED_FontPropertySymbol) { | |
| 21 Label label; | 21 Label label; |
| 22 std::string font_name("symbol"); | 22 std::string font_name("symbol"); |
| 23 gfx::Font font(font_name, 26); | 23 gfx::Font font(font_name, 26); |
| 24 label.SetFontList(gfx::FontList(font)); | 24 label.SetFontList(gfx::FontList(font)); |
| 25 gfx::Font font_used = label.font_list().GetPrimaryFont(); | 25 gfx::Font font_used = label.font_list().GetPrimaryFont(); |
| 26 EXPECT_EQ(font_name, font_used.GetFontName()); | 26 EXPECT_EQ(font_name, font_used.GetFontName()); |
| 27 EXPECT_EQ(26, font_used.GetFontSize()); | 27 EXPECT_EQ(26, font_used.GetFontSize()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 TEST(LabelTest, FontPropertyArial) { | 30 TEST(LabelTest, FontPropertyArial) { |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 51))); | 923 EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 51))); |
| 924 EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(-1, 20))); | 924 EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(-1, 20))); |
| 925 | 925 |
| 926 // GetTooltipHandlerForPoint works should work in child bounds. | 926 // GetTooltipHandlerForPoint works should work in child bounds. |
| 927 label.SetBounds(2, 2, 10, 10); | 927 label.SetBounds(2, 2, 10, 10); |
| 928 EXPECT_EQ(&label, label.GetTooltipHandlerForPoint(gfx::Point(1, 5))); | 928 EXPECT_EQ(&label, label.GetTooltipHandlerForPoint(gfx::Point(1, 5))); |
| 929 EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(3, 11))); | 929 EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(3, 11))); |
| 930 } | 930 } |
| 931 | 931 |
| 932 } // namespace views | 932 } // namespace views |
| OLD | NEW |