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

Unified Diff: ui/views/focus/focus_manager_unittest.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Make patch smaller temporarily. Created 4 years, 9 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/focus/focus_manager_unittest.cc
diff --git a/ui/views/focus/focus_manager_unittest.cc b/ui/views/focus/focus_manager_unittest.cc
index 1c4f3502dbd86a0a6bb2d45f182536ffa3e68a30..32555ffcb4aab60d941e353bb00d566553b0bee0 100644
--- a/ui/views/focus/focus_manager_unittest.cc
+++ b/ui/views/focus/focus_manager_unittest.cc
@@ -784,19 +784,23 @@ TEST_F(FocusManagerArrowKeyTraversalTest, ArrowKeyTraversal) {
}
TEST_F(FocusManagerTest, StoreFocusedView) {
- View view;
- GetFocusManager()->SetFocusedView(&view);
+ View* view = new View;
+ // Add view to the view hierarchy and make it focusable.
+ GetWidget()->GetRootView()->AddChildView(view);
+ view->SetFocusable(true);
+
+ GetFocusManager()->SetFocusedView(view);
GetFocusManager()->StoreFocusedView(false);
EXPECT_EQ(NULL, GetFocusManager()->GetFocusedView());
EXPECT_TRUE(GetFocusManager()->RestoreFocusedView());
- EXPECT_EQ(&view, GetFocusManager()->GetStoredFocusView());
+ EXPECT_EQ(view, GetFocusManager()->GetStoredFocusView());
// Repeat with |true|.
- GetFocusManager()->SetFocusedView(&view);
+ GetFocusManager()->SetFocusedView(view);
GetFocusManager()->StoreFocusedView(true);
EXPECT_EQ(NULL, GetFocusManager()->GetFocusedView());
EXPECT_TRUE(GetFocusManager()->RestoreFocusedView());
- EXPECT_EQ(&view, GetFocusManager()->GetStoredFocusView());
+ EXPECT_EQ(view, GetFocusManager()->GetStoredFocusView());
}
namespace {

Powered by Google App Engine
This is Rietveld 408576698