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

Side by Side Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 11082002: Remove TOGGLE_MAXIMIZED_* from Ash reserved actions list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix AcceleratorControllerTest.WindowSnap Created 8 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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(TOGGLE_MAXIMIZED_RELEASED, dummy);
454 GetController()->PerformAction(TOGGLE_MAXIMIZED_PRESSED, dummy);
455 EXPECT_TRUE(wm::IsWindowMaximized(window.get()));
456 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString());
457
458 GetController()->PerformAction(TOGGLE_MAXIMIZED_PRESSED, dummy);
459 EXPECT_TRUE(wm::IsWindowMaximized(window.get()));
460 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString());
461
462 GetController()->PerformAction(TOGGLE_MAXIMIZED_RELEASED, dummy);
463 GetController()->PerformAction(TOGGLE_MAXIMIZED_PRESSED, dummy);
464 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); 453 EXPECT_FALSE(wm::IsWindowMaximized(window.get()));
465 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); 454 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString());
466 455
467 GetController()->PerformAction(TOGGLE_MAXIMIZED_RELEASED, dummy); 456 ash::wm::MaximizeWindow(window.get());
468 GetController()->PerformAction(TOGGLE_MAXIMIZED_PRESSED, dummy); 457 EXPECT_TRUE(wm::IsWindowMaximized(window.get()));
469 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); 458 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy);
470 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); 459 EXPECT_FALSE(wm::IsWindowMaximized(window.get()));
471 460
472 GetController()->PerformAction(TOGGLE_MAXIMIZED_RELEASED, dummy); 461 ash::wm::MaximizeWindow(window.get());
473 GetController()->PerformAction(TOGGLE_MAXIMIZED_PRESSED, dummy); 462 EXPECT_TRUE(wm::IsWindowMaximized(window.get()));
474 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); 463 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy);
475 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); 464 EXPECT_FALSE(wm::IsWindowMaximized(window.get()));
476 465
477 GetController()->PerformAction(TOGGLE_MAXIMIZED_RELEASED, dummy); 466 ash::wm::MaximizeWindow(window.get());
478 GetController()->PerformAction(TOGGLE_MAXIMIZED_PRESSED, dummy);
479 GetController()->PerformAction(TOGGLE_MAXIMIZED_RELEASED, dummy);
480 EXPECT_TRUE(wm::IsWindowMaximized(window.get())); 467 EXPECT_TRUE(wm::IsWindowMaximized(window.get()));
481 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); 468 GetController()->PerformAction(WINDOW_MINIMIZE, dummy);
482 EXPECT_FALSE(wm::IsWindowMaximized(window.get())); 469 EXPECT_FALSE(wm::IsWindowMaximized(window.get()));
483 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); 470 EXPECT_TRUE(wm::IsWindowMinimized(window.get()));
484 wm::RestoreWindow(window.get()); 471 wm::RestoreWindow(window.get());
485 wm::ActivateWindow(window.get()); 472 wm::ActivateWindow(window.get());
486 } 473 }
487 { 474 {
488 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); 475 GetController()->PerformAction(WINDOW_MINIMIZE, dummy);
489 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); 476 EXPECT_TRUE(wm::IsWindowMinimized(window.get()));
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 EXPECT_FALSE(GetController()->IsReservedAccelerator( 995 EXPECT_FALSE(GetController()->IsReservedAccelerator(
1009 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE))); 996 ui::Accelerator(ui::VKEY_PRINT, ui::EF_NONE)));
1010 EXPECT_FALSE(GetController()->IsReservedAccelerator( 997 EXPECT_FALSE(GetController()->IsReservedAccelerator(
1011 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE))); 998 ui::Accelerator(ui::VKEY_TAB, ui::EF_NONE)));
1012 EXPECT_FALSE(GetController()->IsReservedAccelerator( 999 EXPECT_FALSE(GetController()->IsReservedAccelerator(
1013 ui::Accelerator(ui::VKEY_A, ui::EF_NONE))); 1000 ui::Accelerator(ui::VKEY_A, ui::EF_NONE)));
1014 } 1001 }
1015 1002
1016 } // namespace test 1003 } // namespace test
1017 } // namespace ash 1004 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698