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/utf_string_conversions.h" | 6 #include "base/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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 EXPECT_EQ(30, font_used.GetFontSize()); | 40 EXPECT_EQ(30, font_used.GetFontSize()); |
41 } | 41 } |
42 | 42 |
43 TEST(LabelTest, TextProperty) { | 43 TEST(LabelTest, TextProperty) { |
44 Label label; | 44 Label label; |
45 string16 test_text(ASCIIToUTF16("A random string.")); | 45 string16 test_text(ASCIIToUTF16("A random string.")); |
46 label.SetText(test_text); | 46 label.SetText(test_text); |
47 EXPECT_EQ(test_text, label.text()); | 47 EXPECT_EQ(test_text, label.text()); |
48 } | 48 } |
49 | 49 |
50 TEST(LabelTest, UrlProperty) { | |
51 Label label; | |
52 std::string my_url("http://www.orkut.com/some/Random/path"); | |
53 GURL url(my_url); | |
54 label.SetURL(url); | |
55 EXPECT_EQ(UTF8ToUTF16(my_url), label.text()); | |
56 } | |
57 | |
58 TEST(LabelTest, ColorProperty) { | 50 TEST(LabelTest, ColorProperty) { |
59 Label label; | 51 Label label; |
60 SkColor color = SkColorSetARGB(20, 40, 10, 5); | 52 SkColor color = SkColorSetARGB(20, 40, 10, 5); |
61 label.SetAutoColorReadabilityEnabled(false); | 53 label.SetAutoColorReadabilityEnabled(false); |
62 label.SetEnabledColor(color); | 54 label.SetEnabledColor(color); |
63 EXPECT_EQ(color, label.enabled_color()); | 55 EXPECT_EQ(color, label.enabled_color()); |
64 } | 56 } |
65 | 57 |
66 TEST(LabelTest, AlignmentProperty) { | 58 TEST(LabelTest, AlignmentProperty) { |
67 Label label; | 59 Label label; |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 EXPECT_EQ( | 841 EXPECT_EQ( |
850 0, label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING); | 842 0, label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING); |
851 | 843 |
852 label.SetBackgroundColor(SkColorSetARGB(64, 255, 255, 255)); | 844 label.SetBackgroundColor(SkColorSetARGB(64, 255, 255, 255)); |
853 EXPECT_EQ( | 845 EXPECT_EQ( |
854 gfx::Canvas::NO_SUBPIXEL_RENDERING, | 846 gfx::Canvas::NO_SUBPIXEL_RENDERING, |
855 label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING); | 847 label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING); |
856 } | 848 } |
857 | 849 |
858 } // namespace views | 850 } // namespace views |
OLD | NEW |