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

Unified Diff: views/focus/focus_manager_unittest.cc

Issue 125130: Fix focus traversal cycle. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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 | « views/focus/focus_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/focus_manager_unittest.cc
===================================================================
--- views/focus/focus_manager_unittest.cc (revision 18389)
+++ views/focus/focus_manager_unittest.cc (working copy)
@@ -885,11 +885,8 @@
}
}
- // Focus the 1st item.
- GetFocusManager()->SetFocusedView(
- content_view_->GetViewByID(kTraversalIDs[0]));
-
// Let's traverse in reverse order.
+ GetFocusManager()->SetFocusedView(NULL);
for (int i = 0; i < 3; ++i) {
for (int j = arraysize(kTraversalIDs) - 1; j >= 0; --j) {
GetFocusManager()->AdvanceFocus(true);
@@ -931,6 +928,7 @@
View* focused_view;
// Let's do one traversal (several times, to make sure it loops ok).
+ GetFocusManager()->SetFocusedView(NULL);
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < arraysize(kTraversalIDs); j++) {
GetFocusManager()->AdvanceFocus(false);
@@ -941,14 +939,8 @@
}
}
- // Focus the 1st item.
- GetFocusManager()->AdvanceFocus(false);
- focused_view = GetFocusManager()->GetFocusedView();
- EXPECT_TRUE(focused_view != NULL);
- if (focused_view)
- EXPECT_EQ(kTraversalIDs[0], focused_view->GetID());
-
// Same thing in reverse.
+ GetFocusManager()->SetFocusedView(NULL);
for (int i = 0; i < 3; ++i) {
for (int j = arraysize(kTraversalIDs) - 1; j >= 0; --j) {
GetFocusManager()->AdvanceFocus(true);
« no previous file with comments | « views/focus/focus_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698