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