Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: ui/views/controls/label_unittest.cc

Issue 2439693002: MacViews: Use bullets for displaying obscured text. (Closed)
Patch Set: Make kPasswordReplacementChar constexpr. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/gfx/render_text.cc ('K') | « ui/gfx/render_text_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label_unittest.cc
diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
index e2ab5080acce68b819cc58bf0bbcd746d16d6d98..f9ec47cbb3828142beee27c38be438d8301d7d67 100644
--- a/ui/views/controls/label_unittest.cc
+++ b/ui/views/controls/label_unittest.cc
@@ -14,6 +14,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/compositor/canvas_painter.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/render_text.h"
#include "ui/views/border.h"
#include "ui/views/test/focus_manager_test.h"
#include "ui/views/test/views_test_base.h"
@@ -197,12 +198,15 @@ TEST_F(LabelTest, ObscuredProperty) {
label.SetObscured(true);
label.SizeToPreferredSize();
EXPECT_TRUE(label.obscured());
- EXPECT_EQ(ASCIIToUTF16("*********"), label.GetDisplayTextForTesting());
+ EXPECT_EQ(base::string16(test_text.size(),
+ gfx::RenderText::kPasswordReplacementChar),
+ label.GetDisplayTextForTesting());
EXPECT_EQ(test_text, label.text());
label.SetText(test_text + test_text);
label.SizeToPreferredSize();
- EXPECT_EQ(ASCIIToUTF16("******************"),
+ EXPECT_EQ(base::string16(test_text.size() * 2,
+ gfx::RenderText::kPasswordReplacementChar),
label.GetDisplayTextForTesting());
EXPECT_EQ(test_text + test_text, label.text());
@@ -221,7 +225,8 @@ TEST_F(LabelTest, ObscuredSurrogatePair) {
label.SetText(test_text);
label.SetObscured(true);
label.SizeToPreferredSize();
- EXPECT_EQ(ASCIIToUTF16("*"), label.GetDisplayTextForTesting());
+ EXPECT_EQ(base::string16(1, gfx::RenderText::kPasswordReplacementChar),
+ label.GetDisplayTextForTesting());
EXPECT_EQ(test_text, label.text());
}
« ui/gfx/render_text.cc ('K') | « ui/gfx/render_text_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698