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/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/caps_lock_delegate.h" | 9 #include "ash/caps_lock_delegate.h" |
10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 498 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
499 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); | 499 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); |
500 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 500 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
501 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); | 501 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); |
502 | 502 |
503 // It should cycle back to the first snapped position. | 503 // It should cycle back to the first snapped position. |
504 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 504 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
505 EXPECT_EQ(window->bounds().ToString(), snap_right.ToString()); | 505 EXPECT_EQ(window->bounds().ToString(), snap_right.ToString()); |
506 } | 506 } |
507 { | 507 { |
508 gfx::Rect normal_bounds = window->bounds(); | 508 gfx::Rect normal_bounds = window_state->GetRestoreBoundsInParent(); |
509 | 509 |
510 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 510 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
511 EXPECT_TRUE(window_state->IsMaximized()); | 511 EXPECT_TRUE(window_state->IsMaximized()); |
512 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString()); | 512 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString()); |
513 | 513 |
514 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 514 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
515 EXPECT_FALSE(window_state->IsMaximized()); | 515 EXPECT_FALSE(window_state->IsMaximized()); |
| 516 // Window gets restored to its restore bounds since side-maximized state |
| 517 // is treated as a "maximized" state. |
516 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); | 518 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); |
517 | 519 |
518 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 520 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
519 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); | 521 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); |
520 EXPECT_FALSE(window_state->IsMaximized()); | 522 EXPECT_FALSE(window_state->IsMaximized()); |
521 | 523 |
522 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 524 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
523 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 525 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
524 EXPECT_FALSE(window_state->IsMaximized()); | 526 EXPECT_FALSE(window_state->IsMaximized()); |
525 | 527 |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 // Don't alert if we have a minimized window either. | 1383 // Don't alert if we have a minimized window either. |
1382 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); | 1384 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); |
1383 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { | 1385 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { |
1384 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); | 1386 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); |
1385 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); | 1387 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); |
1386 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); | 1388 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); |
1387 } | 1389 } |
1388 } | 1390 } |
1389 | 1391 |
1390 } // namespace ash | 1392 } // namespace ash |
OLD | NEW |