OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
6 #include "base/i18n/rtl.h" | 6 #include "base/i18n/rtl.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "gfx/canvas.h" | 8 #include "gfx/canvas.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "views/border.h" | 10 #include "views/border.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 label.SetFont(font); | 24 label.SetFont(font); |
25 gfx::Font font_used = label.font(); | 25 gfx::Font font_used = label.font(); |
26 EXPECT_EQ(font_name, font_used.FontName()); | 26 EXPECT_EQ(font_name, font_used.FontName()); |
27 EXPECT_EQ(30, font_used.FontSize()); | 27 EXPECT_EQ(30, font_used.FontSize()); |
28 } | 28 } |
29 #endif | 29 #endif |
30 | 30 |
31 TEST(LabelTest, FontPropertyArial) { | 31 TEST(LabelTest, FontPropertyArial) { |
32 Label label; | 32 Label label; |
33 std::wstring font_name(L"arial"); | 33 std::wstring font_name(L"arial"); |
34 gfx::Font font = gfx::Font::CreateFont(font_name, 30); | 34 gfx::Font font(font_name, 30); |
35 label.SetFont(font); | 35 label.SetFont(font); |
36 gfx::Font font_used = label.font(); | 36 gfx::Font font_used = label.font(); |
37 EXPECT_EQ(font_name, font_used.FontName()); | 37 EXPECT_EQ(font_name, font_used.GetFontName()); |
38 EXPECT_EQ(30, font_used.FontSize()); | 38 EXPECT_EQ(30, font_used.GetFontSize()); |
39 } | 39 } |
40 | 40 |
41 TEST(LabelTest, TextProperty) { | 41 TEST(LabelTest, TextProperty) { |
42 Label label; | 42 Label label; |
43 std::wstring test_text(L"A random string."); | 43 std::wstring test_text(L"A random string."); |
44 label.SetText(test_text); | 44 label.SetText(test_text); |
45 EXPECT_EQ(test_text, label.GetText()); | 45 EXPECT_EQ(test_text, label.GetText()); |
46 } | 46 } |
47 | 47 |
48 TEST(LabelTest, UrlProperty) { | 48 TEST(LabelTest, UrlProperty) { |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 gfx::Canvas::TEXT_ALIGN_LEFT | | 811 gfx::Canvas::TEXT_ALIGN_LEFT | |
812 gfx::Canvas::NO_ELLIPSIS, | 812 gfx::Canvas::NO_ELLIPSIS, |
813 flags); | 813 flags); |
814 #endif | 814 #endif |
815 | 815 |
816 // Reset Locale | 816 // Reset Locale |
817 base::i18n::SetICUDefaultLocale(locale); | 817 base::i18n::SetICUDefaultLocale(locale); |
818 } | 818 } |
819 | 819 |
820 } // namespace views | 820 } // namespace views |
OLD | NEW |