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

Unified Diff: ui/views/view_unittest.cc

Issue 1924893003: Views: Replace View::focusable() with View::focus_behavior(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: 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
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 7ffd8624ea58b4c00ce88f95253655d1075e63fa..89e3c1bb94db3192ab7ad385b757aefc7e79e4f2 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -239,7 +239,7 @@ class TestView : public View {
views::View::Blur();
}
- bool focusable() const { return View::focusable(); }
+ FocusBehavior focus_behavior() const { return View::focus_behavior(); }
void set_can_process_events_within_subtree(bool can_process) {
can_process_events_within_subtree_ = can_process;
@@ -4366,15 +4366,17 @@ TEST_F(ViewTest, FocusableAssertions) {
// which effects the preferred size. To avoid preferred size changing around
// these Views need to key off the last value set to SetFocusBehavior(), not
// whether the View is focusable right now. For this reason it's important
- // that the return value of focusable() depends on the last value passed to
- // SetFocusBehavior and not whether the View is focusable right now.
+ // that the return value of focus_behavior() depends on the last value passed
+ // to SetFocusBehavior and not whether the View is focusable right now.
TestView view;
view.SetFocusBehavior(View::FocusBehavior::ALWAYS);
- EXPECT_TRUE(view.focusable());
+ EXPECT_EQ(View::FocusBehavior::ALWAYS, view.focus_behavior());
view.SetEnabled(false);
- EXPECT_TRUE(view.focusable());
+ EXPECT_EQ(View::FocusBehavior::ALWAYS, view.focus_behavior());
view.SetFocusBehavior(View::FocusBehavior::NEVER);
- EXPECT_FALSE(view.focusable());
+ EXPECT_EQ(View::FocusBehavior::NEVER, view.focus_behavior());
+ view.SetFocusBehavior(View::FocusBehavior::ACCESSIBLE_ONLY);
+ EXPECT_EQ(View::FocusBehavior::ACCESSIBLE_ONLY, view.focus_behavior());
}
// Verifies when a view is deleted it is removed from ViewStorage.
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698