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