| 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 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
| 9 #include "ash/common/accessibility_types.h" | 9 #include "ash/common/accessibility_types.h" |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 462 |
| 463 // Tests activating minimized window. | 463 // Tests activating minimized window. |
| 464 TEST_F(WindowSelectorTest, ActivateMinimized) { | 464 TEST_F(WindowSelectorTest, ActivateMinimized) { |
| 465 gfx::Rect bounds(0, 0, 400, 400); | 465 gfx::Rect bounds(0, 0, 400, 400); |
| 466 std::unique_ptr<aura::Window> window(CreateWindow(bounds)); | 466 std::unique_ptr<aura::Window> window(CreateWindow(bounds)); |
| 467 | 467 |
| 468 wm::WindowState* window_state = wm::GetWindowState(window.get()); | 468 wm::WindowState* window_state = wm::GetWindowState(window.get()); |
| 469 wm::WMEvent minimize_event(wm::WM_EVENT_MINIMIZE); | 469 wm::WMEvent minimize_event(wm::WM_EVENT_MINIMIZE); |
| 470 window_state->OnWMEvent(&minimize_event); | 470 window_state->OnWMEvent(&minimize_event); |
| 471 EXPECT_FALSE(window->IsVisible()); | 471 EXPECT_FALSE(window->IsVisible()); |
| 472 EXPECT_EQ(0.f, window->layer()->GetTargetOpacity()); |
| 472 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, | 473 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, |
| 473 wm::GetWindowState(window.get())->GetStateType()); | 474 wm::GetWindowState(window.get())->GetStateType()); |
| 474 | 475 |
| 475 ToggleOverview(); | 476 ToggleOverview(); |
| 476 | 477 |
| 477 EXPECT_FALSE(window->IsVisible()); | 478 EXPECT_FALSE(window->IsVisible()); |
| 479 EXPECT_EQ(0.f, window->layer()->GetTargetOpacity()); |
| 478 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, | 480 EXPECT_EQ(wm::WINDOW_STATE_TYPE_MINIMIZED, |
| 479 wm::GetWindowState(window.get())->GetStateType()); | 481 wm::GetWindowState(window.get())->GetStateType()); |
| 480 aura::Window* window_for_minimized_window = | 482 aura::Window* window_for_minimized_window = |
| 481 GetOverviewWindowForMinimizedState(0, window.get()); | 483 GetOverviewWindowForMinimizedState(0, window.get()); |
| 482 EXPECT_TRUE(window_for_minimized_window); | 484 EXPECT_TRUE(window_for_minimized_window); |
| 483 | 485 |
| 484 const gfx::Point point = | 486 const gfx::Point point = |
| 485 GetTransformedBoundsInRootWindow(window_for_minimized_window) | 487 GetTransformedBoundsInRootWindow(window_for_minimized_window) |
| 486 .CenterPoint(); | 488 .CenterPoint(); |
| 487 ui::test::EventGenerator event_generator(window->GetRootWindow(), point); | 489 ui::test::EventGenerator event_generator(window->GetRootWindow(), point); |
| 488 event_generator.ClickLeftButton(); | 490 event_generator.ClickLeftButton(); |
| 489 | 491 |
| 490 EXPECT_FALSE(IsSelecting()); | 492 EXPECT_FALSE(IsSelecting()); |
| 491 | 493 |
| 492 EXPECT_TRUE(window->IsVisible()); | 494 EXPECT_TRUE(window->IsVisible()); |
| 495 EXPECT_EQ(1.f, window->layer()->GetTargetOpacity()); |
| 493 EXPECT_EQ(wm::WINDOW_STATE_TYPE_NORMAL, | 496 EXPECT_EQ(wm::WINDOW_STATE_TYPE_NORMAL, |
| 494 wm::GetWindowState(window.get())->GetStateType()); | 497 wm::GetWindowState(window.get())->GetStateType()); |
| 495 } | 498 } |
| 496 | 499 |
| 497 // Tests that entering overview mode with an App-list active properly focuses | 500 // Tests that entering overview mode with an App-list active properly focuses |
| 498 // and activates the overview text filter window. | 501 // and activates the overview text filter window. |
| 499 TEST_F(WindowSelectorTest, TextFilterActive) { | 502 TEST_F(WindowSelectorTest, TextFilterActive) { |
| 500 gfx::Rect bounds(0, 0, 400, 400); | 503 gfx::Rect bounds(0, 0, 400, 400); |
| 501 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 504 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 502 wm::ActivateWindow(window1.get()); | 505 wm::ActivateWindow(window1.get()); |
| (...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 2144 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
| 2142 ASSERT_TRUE(resizer.get()); | 2145 ASSERT_TRUE(resizer.get()); |
| 2143 gfx::Point location = resizer->GetInitialLocation(); | 2146 gfx::Point location = resizer->GetInitialLocation(); |
| 2144 location.Offset(20, 20); | 2147 location.Offset(20, 20); |
| 2145 resizer->Drag(location, 0); | 2148 resizer->Drag(location, 0); |
| 2146 ToggleOverview(); | 2149 ToggleOverview(); |
| 2147 resizer->RevertDrag(); | 2150 resizer->RevertDrag(); |
| 2148 } | 2151 } |
| 2149 | 2152 |
| 2150 } // namespace ash | 2153 } // namespace ash |
| OLD | NEW |