| 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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 #include "ash/accelerators/accelerator_table.h" | 6 #include "ash/accelerators/accelerator_table.h" |
| 7 #include "ash/caps_lock_delegate.h" | 7 #include "ash/caps_lock_delegate.h" |
| 8 #include "ash/display/multi_display_manager.h" | 8 #include "ash/display/multi_display_manager.h" |
| 9 #include "ash/ime_control_delegate.h" | 9 #include "ash/ime_control_delegate.h" |
| 10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 443 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 444 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); | 444 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); |
| 445 | 445 |
| 446 // It should cycle back to the first snapped position. | 446 // It should cycle back to the first snapped position. |
| 447 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 447 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 448 EXPECT_EQ(window->bounds().ToString(), snap_right.ToString()); | 448 EXPECT_EQ(window->bounds().ToString(), snap_right.ToString()); |
| 449 } | 449 } |
| 450 { | 450 { |
| 451 gfx::Rect normal_bounds = window->bounds(); | 451 gfx::Rect normal_bounds = window->bounds(); |
| 452 | 452 |
| 453 GetController()->PerformAction(WINDOW_MAXIMIZE_RESTORE, dummy); | 453 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 454 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); | 454 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); |
| 455 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString()); | 455 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString()); |
| 456 | 456 |
| 457 GetController()->PerformAction(WINDOW_MAXIMIZE_RESTORE, dummy); | 457 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 458 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); | 458 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); |
| 459 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); | 459 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); |
| 460 | 460 |
| 461 GetController()->PerformAction(WINDOW_MAXIMIZE_RESTORE, dummy); | 461 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 462 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); | 462 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); |
| 463 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); | 463 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); |
| 464 | 464 |
| 465 GetController()->PerformAction(WINDOW_MAXIMIZE_RESTORE, dummy); | 465 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 466 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 466 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 467 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); | 467 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); |
| 468 | 468 |
| 469 GetController()->PerformAction(WINDOW_MAXIMIZE_RESTORE, dummy); | 469 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 470 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); | 470 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); |
| 471 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); | 471 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); |
| 472 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); | 472 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); |
| 473 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); | 473 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); |
| 474 wm::RestoreWindow(window.get()); | 474 wm::RestoreWindow(window.get()); |
| 475 wm::ActivateWindow(window.get()); | 475 wm::ActivateWindow(window.get()); |
| 476 } | 476 } |
| 477 { | 477 { |
| 478 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); | 478 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); |
| 479 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); | 479 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 EXPECT_FALSE(GetController()->IsReservedAccelerator( | 1008 EXPECT_FALSE(GetController()->IsReservedAccelerator( |
| 1009 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); | 1009 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); |
| 1010 EXPECT_FALSE(GetController()->IsReservedAccelerator( | 1010 EXPECT_FALSE(GetController()->IsReservedAccelerator( |
| 1011 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE))); | 1011 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE))); |
| 1012 EXPECT_FALSE(GetController()->IsReservedAccelerator( | 1012 EXPECT_FALSE(GetController()->IsReservedAccelerator( |
| 1013 ui::Accelerator(ui::VKEY_A, ui::EF_NONE))); | 1013 ui::Accelerator(ui::VKEY_A, ui::EF_NONE))); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 } // namespace test | 1016 } // namespace test |
| 1017 } // namespace ash | 1017 } // namespace ash |
| OLD | NEW |