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

Unified Diff: ui/aura/root_window_unittest.cc

Issue 11299219: Rework FocusManager as FocusClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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/aura/root_window.cc ('k') | ui/aura/test/aura_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window_unittest.cc
===================================================================
--- ui/aura/root_window_unittest.cc (revision 169818)
+++ ui/aura/root_window_unittest.cc (working copy)
@@ -102,6 +102,10 @@
return window;
}
+bool IsFocusedWindow(aura::Window* window) {
+ return client::GetFocusClient(window)->GetFocusedWindow() == window;
+}
+
} // namespace
typedef test::AuraTestBase RootWindowTest;
@@ -333,21 +337,21 @@
client.GetLockWindow()));
w1->Focus();
- EXPECT_TRUE(w1->GetFocusManager()->IsFocusedWindow(w1));
+ EXPECT_TRUE(IsFocusedWindow(w1));
client.Lock();
// Since we're locked, the attempt to focus w2 will be ignored.
w2->Focus();
- EXPECT_TRUE(w1->GetFocusManager()->IsFocusedWindow(w1));
- EXPECT_FALSE(w1->GetFocusManager()->IsFocusedWindow(w2));
+ EXPECT_TRUE(IsFocusedWindow(w1));
+ EXPECT_FALSE(IsFocusedWindow(w2));
{
// Attempting to send a key event to w1 (not in the lock container) should
// cause focus to be reset.
test::EventGenerator generator(root_window());
generator.PressKey(ui::VKEY_SPACE, 0);
- EXPECT_EQ(NULL, w1->GetFocusManager()->GetFocusedWindow());
+ EXPECT_EQ(NULL, client::GetFocusClient(w1)->GetFocusedWindow());
}
{
@@ -702,7 +706,7 @@
WindowTracker tracker;
DeletingEventFilter* w1_filter = new DeletingEventFilter;
w1->SetEventFilter(w1_filter);
- w1->GetFocusManager()->SetFocusedWindow(w11, NULL);
+ client::GetFocusClient(w1.get())->FocusWindow(w11, NULL);
test::EventGenerator generator(root_window(), w11);
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/aura/test/aura_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698