| 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/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 EXPECT_TRUE(w2_state->IsFullscreen()); | 346 EXPECT_TRUE(w2_state->IsFullscreen()); |
| 347 EXPECT_TRUE(w1->layer()->IsDrawn()); | 347 EXPECT_TRUE(w1->layer()->IsDrawn()); |
| 348 EXPECT_TRUE(w2->layer()->IsDrawn()); | 348 EXPECT_TRUE(w2->layer()->IsDrawn()); |
| 349 | 349 |
| 350 // Minimize the window, which should hide the window. | 350 // Minimize the window, which should hide the window. |
| 351 EXPECT_TRUE(w2_state->IsActive()); | 351 EXPECT_TRUE(w2_state->IsActive()); |
| 352 w2_state->Minimize(); | 352 w2_state->Minimize(); |
| 353 EXPECT_FALSE(w2_state->IsActive()); | 353 EXPECT_FALSE(w2_state->IsActive()); |
| 354 EXPECT_FALSE(w2->layer()->IsDrawn()); | 354 EXPECT_FALSE(w2->layer()->IsDrawn()); |
| 355 EXPECT_TRUE(w1_state->IsActive()); | 355 EXPECT_TRUE(w1_state->IsActive()); |
| 356 EXPECT_EQ(w2.get(), GetDesktop()->children()[0]); |
| 357 EXPECT_EQ(w1.get(), GetDesktop()->children()[1]); |
| 356 | 358 |
| 357 // Make the window normal. | 359 // Make the window normal. |
| 358 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | 360 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); |
| 359 EXPECT_EQ(w1.get(), GetDesktop()->children()[0]); | 361 // Setting back to normal doesn't change the activation. |
| 360 EXPECT_EQ(w2.get(), GetDesktop()->children()[1]); | 362 EXPECT_FALSE(w2_state->IsActive()); |
| 363 EXPECT_TRUE(w1_state->IsActive()); |
| 364 EXPECT_EQ(w2.get(), GetDesktop()->children()[0]); |
| 365 EXPECT_EQ(w1.get(), GetDesktop()->children()[1]); |
| 361 EXPECT_TRUE(w2->layer()->IsDrawn()); | 366 EXPECT_TRUE(w2->layer()->IsDrawn()); |
| 362 } | 367 } |
| 363 | 368 |
| 364 // Verifies ShelfLayoutManager's visibility/auto-hide state is correctly | 369 // Verifies ShelfLayoutManager's visibility/auto-hide state is correctly |
| 365 // updated. | 370 // updated. |
| 366 TEST_F(WorkspaceControllerTest, ShelfStateUpdated) { | 371 TEST_F(WorkspaceControllerTest, ShelfStateUpdated) { |
| 367 // Since ShelfLayoutManager queries for mouse location, move the mouse so | 372 // Since ShelfLayoutManager queries for mouse location, move the mouse so |
| 368 // it isn't over the shelf. | 373 // it isn't over the shelf. |
| 369 aura::test::EventGenerator generator( | 374 aura::test::EventGenerator generator( |
| 370 Shell::GetPrimaryRootWindow(), gfx::Point()); | 375 Shell::GetPrimaryRootWindow(), gfx::Point()); |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 target = targeter->FindTargetForEvent(root, &touch); | 1503 target = targeter->FindTargetForEvent(root, &touch); |
| 1499 if (points[i].is_target_hit) | 1504 if (points[i].is_target_hit) |
| 1500 EXPECT_EQ(window.get(), target); | 1505 EXPECT_EQ(window.get(), target); |
| 1501 else | 1506 else |
| 1502 EXPECT_NE(window.get(), target); | 1507 EXPECT_NE(window.get(), target); |
| 1503 } | 1508 } |
| 1504 } | 1509 } |
| 1505 | 1510 |
| 1506 } // namespace internal | 1511 } // namespace internal |
| 1507 } // namespace ash | 1512 } // namespace ash |
| OLD | NEW |