| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 std::string my_url("http://www.orkut.com/some/Random/path"); | 51 std::string my_url("http://www.orkut.com/some/Random/path"); |
| 52 GURL url(my_url); | 52 GURL url(my_url); |
| 53 label.SetURL(url); | 53 label.SetURL(url); |
| 54 EXPECT_EQ(my_url, label.GetURL().spec()); | 54 EXPECT_EQ(my_url, label.GetURL().spec()); |
| 55 EXPECT_EQ(UTF8ToUTF16(my_url), label.GetText()); | 55 EXPECT_EQ(UTF8ToUTF16(my_url), label.GetText()); |
| 56 } | 56 } |
| 57 | 57 |
| 58 TEST(LabelTest, ColorProperty) { | 58 TEST(LabelTest, ColorProperty) { |
| 59 Label label; | 59 Label label; |
| 60 SkColor color = SkColorSetARGB(20, 40, 10, 5); | 60 SkColor color = SkColorSetARGB(20, 40, 10, 5); |
| 61 label.SetColor(color); | 61 label.SetAutoColorReadabilityEnabled(false); |
| 62 EXPECT_EQ(color, label.GetColor()); | 62 label.SetEnabledColor(color); |
| 63 EXPECT_EQ(color, label.enabled_color()); |
| 63 } | 64 } |
| 64 | 65 |
| 65 TEST(LabelTest, AlignmentProperty) { | 66 TEST(LabelTest, AlignmentProperty) { |
| 66 Label label; | 67 Label label; |
| 67 bool reverse_alignment = base::i18n::IsRTL(); | 68 bool reverse_alignment = base::i18n::IsRTL(); |
| 68 | 69 |
| 69 label.SetHorizontalAlignment(Label::ALIGN_RIGHT); | 70 label.SetHorizontalAlignment(Label::ALIGN_RIGHT); |
| 70 EXPECT_EQ( | 71 EXPECT_EQ( |
| 71 reverse_alignment ? Label::ALIGN_LEFT : Label::ALIGN_RIGHT, | 72 reverse_alignment ? Label::ALIGN_LEFT : Label::ALIGN_RIGHT, |
| 72 label.horizontal_alignment()); | 73 label.horizontal_alignment()); |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 gfx::Canvas::TEXT_ALIGN_LEFT | | 802 gfx::Canvas::TEXT_ALIGN_LEFT | |
| 802 gfx::Canvas::NO_ELLIPSIS, | 803 gfx::Canvas::NO_ELLIPSIS, |
| 803 flags); | 804 flags); |
| 804 #endif | 805 #endif |
| 805 | 806 |
| 806 // Reset Locale | 807 // Reset Locale |
| 807 base::i18n::SetICUDefaultLocale(locale); | 808 base::i18n::SetICUDefaultLocale(locale); |
| 808 } | 809 } |
| 809 | 810 |
| 810 } // namespace views | 811 } // namespace views |
| OLD | NEW |