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

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

Issue 1870573003: Full Keyboard Access: Second Approach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/focus/focus_manager.cc ('k') | ui/views/focus/focus_search.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « ui/views/focus/focus_manager.cc ('k') | ui/views/focus/focus_search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698