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

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

Issue 1898633004: Views: Add new SetFocusBehavior method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 8 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
Index: ui/views/controls/label_unittest.cc
diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
index ef896fdccc6cc9d80bad753161fd5aa1c7b473c8..f2cf5ea9940c9d38acdc732b3fddefdd3ed7b2df 100644
--- a/ui/views/controls/label_unittest.cc
+++ b/ui/views/controls/label_unittest.cc
@@ -376,7 +376,7 @@ TEST_F(LabelTest, PreferredSizeForAllowCharacterBreak) {
TEST_F(LabelTest, MultiLineSizing) {
Label label;
- label.SetFocusable(false);
+ label.SetFocusBehavior(View::FocusBehavior::NEVER);
tapted 2016/04/20 04:16:28 the NEVERs here and on line 464 can be deleted - i
karandeepb 2016/04/21 03:16:33 Done. Didn't find anything interesting in git blam
label.SetText(
ASCIIToUTF16("A random string\nwith multiple lines\nand returns!"));
label.SetMultiLine(true);
@@ -461,7 +461,7 @@ TEST_F(LabelTest, MultiLineSizingWithElide) {
const base::string16 text =
ASCIIToUTF16("A random string\nwith multiple lines\nand returns!");
Label label;
- label.SetFocusable(false);
+ label.SetFocusBehavior(View::FocusBehavior::NEVER);
label.SetText(text);
label.SetMultiLine(true);
@@ -612,7 +612,7 @@ TEST_F(LabelFocusTest, FocusBounds) {
label()->SetText(ASCIIToUTF16("Example"));
gfx::Size normal_size = label()->GetPreferredSize();
- label()->SetFocusable(true);
+ label()->SetFocusBehavior(View::FocusBehavior::ALWAYS);
label()->RequestFocus();
gfx::Size focusable_size = label()->GetPreferredSize();
// Focusable label requires larger size to paint the focus rectangle.
@@ -649,7 +649,7 @@ TEST_F(LabelFocusTest, FocusBounds) {
}
TEST_F(LabelFocusTest, EmptyLabel) {
- label()->SetFocusable(true);
+ label()->SetFocusBehavior(View::FocusBehavior::ALWAYS);
label()->RequestFocus();
label()->SizeToPreferredSize();

Powered by Google App Engine
This is Rietveld 408576698