OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/shell_window_ids.h" | 6 #include "ash/shell_window_ids.h" |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "ash/test/test_activation_delegate.h" | 8 #include "ash/test/test_activation_delegate.h" |
9 #include "ash/wm/activation_controller.h" | 9 #include "ash/wm/activation_controller.h" |
10 #include "ash/wm/cursor_manager.h" | 10 #include "ash/wm/cursor_manager.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 w122->Focus(); | 143 w122->Focus(); |
144 EXPECT_EQ(w122.get(), w12->GetFocusManager()->GetFocusedWindow()); | 144 EXPECT_EQ(w122.get(), w12->GetFocusManager()->GetFocusedWindow()); |
145 | 145 |
146 // Removing the focused window from parent should set the focus to | 146 // Removing the focused window from parent should set the focus to |
147 // its parent if it's focusable. | 147 // its parent if it's focusable. |
148 w12->RemoveChild(w122.get()); | 148 w12->RemoveChild(w122.get()); |
149 EXPECT_EQ(NULL, w122->GetFocusManager()); | 149 EXPECT_EQ(NULL, w122->GetFocusManager()); |
150 EXPECT_EQ(w12.get(), w12->GetFocusManager()->GetFocusedWindow()); | 150 EXPECT_EQ(w12.get(), w12->GetFocusManager()->GetFocusedWindow()); |
151 | 151 |
152 // Set the focus to w123, but make the w1 not activatable. | 152 // Set the focus to w123, but make the w1 not activatable. |
153 test::TestActivationDelegate *activation_delegate = new | 153 test::TestActivationDelegate* activation_delegate = new |
154 test::TestActivationDelegate(false); | 154 test::TestActivationDelegate(false); |
155 w123->Focus(); | 155 w123->Focus(); |
156 EXPECT_EQ(w123.get(), w12->GetFocusManager()->GetFocusedWindow()); | 156 EXPECT_EQ(w123.get(), w12->GetFocusManager()->GetFocusedWindow()); |
157 aura::client::SetActivationDelegate(w1.get(), activation_delegate); | 157 aura::client::SetActivationDelegate(w1.get(), activation_delegate); |
158 | 158 |
159 // Hiding the focused window will set the focus to NULL because | 159 // Hiding the focused window will set the focus to NULL because |
160 // parent window is not focusable. | 160 // parent window is not focusable. |
161 w123->Hide(); | 161 w123->Hide(); |
162 EXPECT_EQ(w12->GetFocusManager(), w123->GetFocusManager()); | 162 EXPECT_EQ(w12->GetFocusManager(), w123->GetFocusManager()); |
163 EXPECT_EQ(NULL, w12->GetFocusManager()->GetFocusedWindow()); | 163 EXPECT_EQ(NULL, w12->GetFocusManager()->GetFocusedWindow()); |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 env_filter->set_update_cursor_visibility(false); | 595 env_filter->set_update_cursor_visibility(false); |
596 cursor_manager->ShowCursor(false); | 596 cursor_manager->ShowCursor(false); |
597 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); | 597 root_window->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse_moved); |
598 EXPECT_FALSE(cursor_manager->cursor_visible()); | 598 EXPECT_FALSE(cursor_manager->cursor_visible()); |
599 cursor_manager->ShowCursor(true); | 599 cursor_manager->ShowCursor(true); |
600 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); | 600 root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&touch_pressed2); |
601 EXPECT_TRUE(cursor_manager->cursor_visible()); | 601 EXPECT_TRUE(cursor_manager->cursor_visible()); |
602 } | 602 } |
603 | 603 |
604 } // namespace ash | 604 } // namespace ash |
OLD | NEW |