OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/drag_drop/drag_drop_controller.h" | 8 #include "ash/drag_drop/drag_drop_controller.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 // Crashes after the skia roll in http://crrev.com/274114. | 451 // Crashes after the skia roll in http://crrev.com/274114. |
452 // http://crbug.com/379570 | 452 // http://crbug.com/379570 |
453 TEST_F(WindowSelectorTest, DISABLED_MinimizedWindowVisibility) { | 453 TEST_F(WindowSelectorTest, DISABLED_MinimizedWindowVisibility) { |
454 gfx::Rect bounds(0, 0, 400, 400); | 454 gfx::Rect bounds(0, 0, 400, 400); |
455 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); | 455 scoped_ptr<aura::Window> window1(CreateWindow(bounds)); |
456 wm::WindowState* window_state = wm::GetWindowState(window1.get()); | 456 wm::WindowState* window_state = wm::GetWindowState(window1.get()); |
457 window_state->Minimize(); | 457 window_state->Minimize(); |
458 EXPECT_FALSE(window1->IsVisible()); | 458 EXPECT_FALSE(window1->IsVisible()); |
459 EXPECT_FALSE(window1->layer()->GetTargetVisibility()); | 459 EXPECT_FALSE(window1->layer()->GetTargetVisibility()); |
460 { | 460 { |
461 ui::ScopedAnimationDurationScaleMode normal_duration_mode( | 461 ui::ScopedAnimationDurationScaleMode test_duration_mode( |
462 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); | 462 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); |
463 ToggleOverview(); | 463 ToggleOverview(); |
464 EXPECT_TRUE(window1->IsVisible()); | 464 EXPECT_TRUE(window1->IsVisible()); |
465 EXPECT_TRUE(window1->layer()->GetTargetVisibility()); | 465 EXPECT_TRUE(window1->layer()->GetTargetVisibility()); |
466 } | 466 } |
467 { | 467 { |
468 ui::ScopedAnimationDurationScaleMode normal_duration_mode( | 468 ui::ScopedAnimationDurationScaleMode test_duration_mode( |
469 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); | 469 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); |
470 ToggleOverview(); | 470 ToggleOverview(); |
471 EXPECT_FALSE(window1->IsVisible()); | 471 EXPECT_FALSE(window1->IsVisible()); |
472 EXPECT_FALSE(window1->layer()->GetTargetVisibility()); | 472 EXPECT_FALSE(window1->layer()->GetTargetVisibility()); |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 // Tests that a bounds change during overview is corrected for. | 476 // Tests that a bounds change during overview is corrected for. |
477 TEST_F(WindowSelectorTest, BoundsChangeDuringOverview) { | 477 TEST_F(WindowSelectorTest, BoundsChangeDuringOverview) { |
478 scoped_ptr<aura::Window> window(CreateWindow(gfx::Rect(0, 0, 400, 400))); | 478 scoped_ptr<aura::Window> window(CreateWindow(gfx::Rect(0, 0, 400, 400))); |
479 ToggleOverview(); | 479 ToggleOverview(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 TEST_F(WindowSelectorTest, QuickReentryRestoresInitialTransform) { | 554 TEST_F(WindowSelectorTest, QuickReentryRestoresInitialTransform) { |
555 gfx::Rect bounds(0, 0, 400, 400); | 555 gfx::Rect bounds(0, 0, 400, 400); |
556 scoped_ptr<aura::Window> window(CreateWindow(bounds)); | 556 scoped_ptr<aura::Window> window(CreateWindow(bounds)); |
557 gfx::Rect initial_bounds = ToEnclosingRect( | 557 gfx::Rect initial_bounds = ToEnclosingRect( |
558 GetTransformedBounds(window.get())); | 558 GetTransformedBounds(window.get())); |
559 ToggleOverview(); | 559 ToggleOverview(); |
560 // Quickly exit and reenter overview mode. The window should still be | 560 // Quickly exit and reenter overview mode. The window should still be |
561 // animating when we reenter. We cannot short circuit animations for this but | 561 // animating when we reenter. We cannot short circuit animations for this but |
562 // we also don't have to wait for them to complete. | 562 // we also don't have to wait for them to complete. |
563 { | 563 { |
564 ui::ScopedAnimationDurationScaleMode normal_duration_mode( | 564 ui::ScopedAnimationDurationScaleMode test_duration_mode( |
565 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); | 565 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); |
566 ToggleOverview(); | 566 ToggleOverview(); |
567 ToggleOverview(); | 567 ToggleOverview(); |
568 } | 568 } |
569 EXPECT_NE(initial_bounds, ToEnclosingRect( | 569 EXPECT_NE(initial_bounds, ToEnclosingRect( |
570 GetTransformedTargetBounds(window.get()))); | 570 GetTransformedTargetBounds(window.get()))); |
571 ToggleOverview(); | 571 ToggleOverview(); |
572 EXPECT_FALSE(IsSelecting()); | 572 EXPECT_FALSE(IsSelecting()); |
573 EXPECT_EQ(initial_bounds, ToEnclosingRect( | 573 EXPECT_EQ(initial_bounds, ToEnclosingRect( |
574 GetTransformedTargetBounds(window.get()))); | 574 GetTransformedTargetBounds(window.get()))); |
575 } | 575 } |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 // Dimming all the items should hide the selection widget. | 1115 // Dimming all the items should hide the selection widget. |
1116 FilterItems("Pop"); | 1116 FilterItems("Pop"); |
1117 EXPECT_FALSE(selection_widget_active()); | 1117 EXPECT_FALSE(selection_widget_active()); |
1118 | 1118 |
1119 // Undimming one window should automatically select it. | 1119 // Undimming one window should automatically select it. |
1120 FilterItems("Rock and roll"); | 1120 FilterItems("Rock and roll"); |
1121 EXPECT_EQ(GetSelectedWindow(), window2.get()); | 1121 EXPECT_EQ(GetSelectedWindow(), window2.get()); |
1122 } | 1122 } |
1123 | 1123 |
1124 } // namespace ash | 1124 } // namespace ash |
OLD | NEW |