| 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/focus_cycler.h" | 5 #include "ash/focus_cycler.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // Back to the shelf. | 376 // Back to the shelf. |
| 377 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); | 377 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); |
| 378 EXPECT_TRUE(shelf_widget()->IsActive()); | 378 EXPECT_TRUE(shelf_widget()->IsActive()); |
| 379 | 379 |
| 380 // Back to the status area. | 380 // Back to the status area. |
| 381 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); | 381 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); |
| 382 EXPECT_TRUE(tray()->GetWidget()->IsActive()); | 382 EXPECT_TRUE(tray()->GetWidget()->IsActive()); |
| 383 | 383 |
| 384 // Pressing "Escape" while on the status area should | 384 // Pressing "Escape" while on the status area should |
| 385 // deactivate it, and activate the browser window. | 385 // deactivate it, and activate the browser window. |
| 386 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 386 aura::Window* root = Shell::GetPrimaryRootWindow(); |
| 387 aura::test::EventGenerator event_generator(root, root); | 387 aura::test::EventGenerator event_generator(root, root); |
| 388 event_generator.PressKey(ui::VKEY_ESCAPE, 0); | 388 event_generator.PressKey(ui::VKEY_ESCAPE, 0); |
| 389 EXPECT_TRUE(wm::IsActiveWindow(browser_window)); | 389 EXPECT_TRUE(wm::IsActiveWindow(browser_window)); |
| 390 EXPECT_EQ(focus_manager->GetFocusedView(), view1); | 390 EXPECT_EQ(focus_manager->GetFocusedView(), view1); |
| 391 | 391 |
| 392 // Similarly, pressing "Escape" while on the shelf. | 392 // Similarly, pressing "Escape" while on the shelf. |
| 393 // should do the same thing. | 393 // should do the same thing. |
| 394 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); | 394 focus_cycler()->RotateFocus(FocusCycler::BACKWARD); |
| 395 EXPECT_TRUE(shelf_widget()->IsActive()); | 395 EXPECT_TRUE(shelf_widget()->IsActive()); |
| 396 event_generator.PressKey(ui::VKEY_ESCAPE, 0); | 396 event_generator.PressKey(ui::VKEY_ESCAPE, 0); |
| 397 EXPECT_TRUE(wm::IsActiveWindow(browser_window)); | 397 EXPECT_TRUE(wm::IsActiveWindow(browser_window)); |
| 398 EXPECT_EQ(focus_manager->GetFocusedView(), view1); | 398 EXPECT_EQ(focus_manager->GetFocusedView(), view1); |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace test | 401 } // namespace test |
| 402 } // namespace ash | 402 } // namespace ash |
| OLD | NEW |