| 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 "ash/wm/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 EXPECT_TRUE(GetWindowOverlapsShelf()); | 502 EXPECT_TRUE(GetWindowOverlapsShelf()); |
| 503 } | 503 } |
| 504 | 504 |
| 505 // Verifies going from maximized to minimized sets the right state for painting | 505 // Verifies going from maximized to minimized sets the right state for painting |
| 506 // the background of the launcher. | 506 // the background of the launcher. |
| 507 TEST_F(WorkspaceControllerTest, MinimizeResetsVisibility) { | 507 TEST_F(WorkspaceControllerTest, MinimizeResetsVisibility) { |
| 508 std::unique_ptr<Window> w1(CreateTestWindow()); | 508 std::unique_ptr<Window> w1(CreateTestWindow()); |
| 509 w1->Show(); | 509 w1->Show(); |
| 510 wm::ActivateWindow(w1.get()); | 510 wm::ActivateWindow(w1.get()); |
| 511 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 511 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 512 EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, shelf_widget()->GetBackgroundType()); | 512 EXPECT_EQ(wm::SHELF_BACKGROUND_MAXIMIZED, |
| 513 shelf_widget()->GetBackgroundType()); |
| 513 | 514 |
| 514 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); | 515 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
| 515 EXPECT_EQ(SHELF_VISIBLE, | 516 EXPECT_EQ(SHELF_VISIBLE, |
| 516 shelf_layout_manager()->visibility_state()); | 517 shelf_layout_manager()->visibility_state()); |
| 517 EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, shelf_widget()->GetBackgroundType()); | 518 EXPECT_EQ(wm::SHELF_BACKGROUND_DEFAULT, shelf_widget()->GetBackgroundType()); |
| 518 } | 519 } |
| 519 | 520 |
| 520 // Verifies window visibility during various workspace changes. | 521 // Verifies window visibility during various workspace changes. |
| 521 TEST_F(WorkspaceControllerTest, VisibilityTests) { | 522 TEST_F(WorkspaceControllerTest, VisibilityTests) { |
| 522 std::unique_ptr<Window> w1(CreateTestWindow()); | 523 std::unique_ptr<Window> w1(CreateTestWindow()); |
| 523 w1->Show(); | 524 w1->Show(); |
| 524 EXPECT_TRUE(w1->IsVisible()); | 525 EXPECT_TRUE(w1->IsVisible()); |
| 525 EXPECT_EQ(1.0f, w1->layer()->GetCombinedOpacity()); | 526 EXPECT_EQ(1.0f, w1->layer()->GetCombinedOpacity()); |
| 526 | 527 |
| 527 // Create another window, activate it and make it fullscreen. | 528 // Create another window, activate it and make it fullscreen. |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1608 ui::EventTimeForNow()); | 1609 ui::EventTimeForNow()); |
| 1609 target = targeter->FindTargetForEvent(root, &touch); | 1610 target = targeter->FindTargetForEvent(root, &touch); |
| 1610 if (points[i].is_target_hit) | 1611 if (points[i].is_target_hit) |
| 1611 EXPECT_EQ(window.get(), target); | 1612 EXPECT_EQ(window.get(), target); |
| 1612 else | 1613 else |
| 1613 EXPECT_NE(window.get(), target); | 1614 EXPECT_NE(window.get(), target); |
| 1614 } | 1615 } |
| 1615 } | 1616 } |
| 1616 | 1617 |
| 1617 } // namespace ash | 1618 } // namespace ash |
| OLD | NEW |