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

Unified Diff: ui/views/view_unittest.cc

Issue 1915863004: Remove View::focusable() - Alternate approach. (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
« ui/views/controls/label.cc ('K') | « 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..ef093cbea73eaf9c65bcacec933bcfbf24ace30d 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -239,8 +239,6 @@ class TestView : public View {
views::View::Blur();
}
- bool focusable() const { return View::focusable(); }
-
void set_can_process_events_within_subtree(bool can_process) {
can_process_events_within_subtree_ = can_process;
}
@@ -4361,22 +4359,6 @@ TEST_F(ViewLayerTest, SnapLayerToPixel) {
EXPECT_EQ("0.00 0.00", ToString(v11->layer()->subpixel_position_offset()));
}
-TEST_F(ViewTest, FocusableAssertions) {
- // View subclasses may change insets based on whether they are focusable,
- // 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.
- TestView view;
- view.SetFocusBehavior(View::FocusBehavior::ALWAYS);
- EXPECT_TRUE(view.focusable());
- view.SetEnabled(false);
- EXPECT_TRUE(view.focusable());
- view.SetFocusBehavior(View::FocusBehavior::NEVER);
- EXPECT_FALSE(view.focusable());
-}
-
// Verifies when a view is deleted it is removed from ViewStorage.
TEST_F(ViewTest, UpdateViewStorageOnDelete) {
ViewStorage* view_storage = ViewStorage::GetInstance();
« ui/views/controls/label.cc ('K') | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698