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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 w2->SetBounds(gfx::Rect(10, 11, 250, 251)); | 621 w2->SetBounds(gfx::Rect(10, 11, 250, 251)); |
622 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 622 w2->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
623 w2->Show(); | 623 w2->Show(); |
624 wm::ActivateWindow(w2.get()); | 624 wm::ActivateWindow(w2.get()); |
625 | 625 |
626 // Increase the size of the WorkAreaInsets. This would make |w1| fall | 626 // Increase the size of the WorkAreaInsets. This would make |w1| fall |
627 // completely out of the display work area. | 627 // completely out of the display work area. |
628 gfx::Insets insets = | 628 gfx::Insets insets = |
629 Shell::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets(); | 629 Shell::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets(); |
630 insets.Set(0, 0, insets.bottom() + 30, 0); | 630 insets.Set(0, 0, insets.bottom() + 30, 0); |
631 Shell::GetInstance()->SetDisplayWorkAreaInsets(w1.get(), insets); | 631 Shell::GetInstance()->SetDisplayWorkAreaInsetsForTesting(w1.get(), insets); |
632 | 632 |
633 // Switch to w1. The window should have moved. | 633 // Switch to w1. The window should have moved. |
634 wm::ActivateWindow(w1.get()); | 634 wm::ActivateWindow(w1.get()); |
635 EXPECT_NE(w1_bounds.ToString(), w1->bounds().ToString()); | 635 EXPECT_NE(w1_bounds.ToString(), w1->bounds().ToString()); |
636 } | 636 } |
637 | 637 |
638 namespace { | 638 namespace { |
639 | 639 |
640 // WindowDelegate used by DontCrashOnChangeAndActivate. | 640 // WindowDelegate used by DontCrashOnChangeAndActivate. |
641 class DontCrashOnChangeAndActivateDelegate | 641 class DontCrashOnChangeAndActivateDelegate |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 ui::EventTimeForNow()); | 1608 ui::EventTimeForNow()); |
1609 target = targeter->FindTargetForEvent(root, &touch); | 1609 target = targeter->FindTargetForEvent(root, &touch); |
1610 if (points[i].is_target_hit) | 1610 if (points[i].is_target_hit) |
1611 EXPECT_EQ(window.get(), target); | 1611 EXPECT_EQ(window.get(), target); |
1612 else | 1612 else |
1613 EXPECT_NE(window.get(), target); | 1613 EXPECT_NE(window.get(), target); |
1614 } | 1614 } |
1615 } | 1615 } |
1616 | 1616 |
1617 } // namespace ash | 1617 } // namespace ash |
OLD | NEW |