| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 497 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 498 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); | 498 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); |
| 499 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 499 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 500 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); | 500 EXPECT_NE(window->bounds().ToString(), snap_right.ToString()); |
| 501 | 501 |
| 502 // It should cycle back to the first snapped position. | 502 // It should cycle back to the first snapped position. |
| 503 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 503 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 504 EXPECT_EQ(window->bounds().ToString(), snap_right.ToString()); | 504 EXPECT_EQ(window->bounds().ToString(), snap_right.ToString()); |
| 505 } | 505 } |
| 506 { | 506 { |
| 507 gfx::Rect normal_bounds = window->bounds(); | 507 gfx::Rect normal_bounds = window_state->GetRestoreBoundsInParent(); |
| 508 | 508 |
| 509 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 509 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 510 EXPECT_TRUE(window_state->IsMaximized()); | 510 EXPECT_TRUE(window_state->IsMaximized()); |
| 511 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString()); | 511 EXPECT_NE(normal_bounds.ToString(), window->bounds().ToString()); |
| 512 | 512 |
| 513 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 513 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 514 EXPECT_FALSE(window_state->IsMaximized()); | 514 EXPECT_FALSE(window_state->IsMaximized()); |
| 515 // Window gets restored to its restore bounds since side-maximized state |
| 516 // is treated as a "maximized" state. |
| 515 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); | 517 EXPECT_EQ(normal_bounds.ToString(), window->bounds().ToString()); |
| 516 | 518 |
| 517 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 519 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 518 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); | 520 GetController()->PerformAction(WINDOW_SNAP_LEFT, dummy); |
| 519 EXPECT_FALSE(window_state->IsMaximized()); | 521 EXPECT_FALSE(window_state->IsMaximized()); |
| 520 | 522 |
| 521 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); | 523 GetController()->PerformAction(TOGGLE_MAXIMIZED, dummy); |
| 522 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); | 524 GetController()->PerformAction(WINDOW_SNAP_RIGHT, dummy); |
| 523 EXPECT_FALSE(window_state->IsMaximized()); | 525 EXPECT_FALSE(window_state->IsMaximized()); |
| 524 | 526 |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 // Don't alert if we have a minimized window either. | 1357 // Don't alert if we have a minimized window either. |
| 1356 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); | 1358 GetController()->PerformAction(WINDOW_MINIMIZE, dummy); |
| 1357 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { | 1359 for (size_t i = 0; i < kActionsNeedingWindowLength; ++i) { |
| 1358 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); | 1360 delegate->TriggerAccessibilityAlert(A11Y_ALERT_NONE); |
| 1359 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); | 1361 GetController()->PerformAction(kActionsNeedingWindow[i], dummy); |
| 1360 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); | 1362 EXPECT_EQ(delegate->GetLastAccessibilityAlert(), A11Y_ALERT_NONE); |
| 1361 } | 1363 } |
| 1362 } | 1364 } |
| 1363 | 1365 |
| 1364 } // namespace ash | 1366 } // namespace ash |
| OLD | NEW |