diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 03:28:46 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 03:28:46 +0000 |
commit | 8cfb672c1560ea3354b0a51fa2efca3de8249beb (patch) | |
tree | 9e4e4dba8001b6b37a6b2b15070544c26f5008be /ui/aura/root_window_unittest.cc | |
parent | 9bf222b0ada03412fbbb61a5dcf2f6205bb1f0d8 (diff) | |
download | chromium_src-8cfb672c1560ea3354b0a51fa2efca3de8249beb.zip chromium_src-8cfb672c1560ea3354b0a51fa2efca3de8249beb.tar.gz chromium_src-8cfb672c1560ea3354b0a51fa2efca3de8249beb.tar.bz2 |
Rework FocusManager as FocusClient.
This allows us to have multiple focus system implementations.
http://crbug.com/162100
R=sky@chromium.org
Review URL: https://codereview.chromium.org/11299219
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/root_window_unittest.cc')
-rw-r--r-- | ui/aura/root_window_unittest.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ui/aura/root_window_unittest.cc b/ui/aura/root_window_unittest.cc index ec35d99..fdf93f0 100644 --- a/ui/aura/root_window_unittest.cc +++ b/ui/aura/root_window_unittest.cc @@ -102,6 +102,10 @@ Window* CreateWindow(int id, Window* parent, WindowDelegate* delegate) { return window; } +bool IsFocusedWindow(aura::Window* window) { + return client::GetFocusClient(window)->GetFocusedWindow() == window; +} + } // namespace typedef test::AuraTestBase RootWindowTest; @@ -333,21 +337,21 @@ TEST_F(RootWindowTest, CanProcessEventsWithinSubtree) { 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 @@ TEST_F(RootWindowTest, DeleteWindowDuringDispatch) { 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); |