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/launcher/launcher.h" | 5 #include "ash/launcher/launcher.h" |
6 #include "ash/root_window_controller.h" | 6 #include "ash/root_window_controller.h" |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shelf/shelf_widget.h" | 8 #include "ash/shelf/shelf_widget.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 | 783 |
784 gfx::Rect root1_rect(0, 0, 100, 100); | 784 gfx::Rect root1_rect(0, 0, 100, 100); |
785 gfx::Rect root2_rect(450, 0, 100, 100); | 785 gfx::Rect root2_rect(450, 0, 100, 100); |
786 scoped_ptr<aura::Window> unmoved1(CreateWindow(root2_rect)); | 786 scoped_ptr<aura::Window> unmoved1(CreateWindow(root2_rect)); |
787 scoped_ptr<aura::Window> unmoved2(CreateWindow(root2_rect)); | 787 scoped_ptr<aura::Window> unmoved2(CreateWindow(root2_rect)); |
788 scoped_ptr<aura::Window> moved1_trans_parent(CreateWindow(root1_rect)); | 788 scoped_ptr<aura::Window> moved1_trans_parent(CreateWindow(root1_rect)); |
789 scoped_ptr<aura::Window> moved1(CreateWindow(root1_rect)); | 789 scoped_ptr<aura::Window> moved1(CreateWindow(root1_rect)); |
790 unmoved1->SetName("unmoved1"); | 790 unmoved1->SetName("unmoved1"); |
791 unmoved2->SetName("unmoved2"); | 791 unmoved2->SetName("unmoved2"); |
792 moved1->SetName("moved1"); | 792 moved1->SetName("moved1"); |
793 moved1->SetProperty(aura::client::kModalKey, | 793 moved1->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); |
794 ui::MODAL_TYPE_WINDOW); | |
795 moved1_trans_parent->AddTransientChild(moved1.get()); | 794 moved1_trans_parent->AddTransientChild(moved1.get()); |
796 moved1_trans_parent->SetName("moved1_trans_parent"); | 795 moved1_trans_parent->SetName("moved1_trans_parent"); |
797 | 796 |
798 EXPECT_EQ(root_windows[0], moved1->GetRootWindow()); | 797 EXPECT_EQ(root_windows[0], moved1->GetRootWindow()); |
799 EXPECT_EQ(root_windows[0], moved1_trans_parent->GetRootWindow()); | 798 EXPECT_EQ(root_windows[0], moved1_trans_parent->GetRootWindow()); |
800 EXPECT_EQ(root_windows[1], unmoved1->GetRootWindow()); | 799 EXPECT_EQ(root_windows[1], unmoved1->GetRootWindow()); |
801 EXPECT_EQ(root_windows[1], unmoved2->GetRootWindow()); | 800 EXPECT_EQ(root_windows[1], unmoved2->GetRootWindow()); |
802 wm::ActivateWindow(unmoved2.get()); | 801 wm::ActivateWindow(unmoved2.get()); |
803 wm::ActivateWindow(unmoved1.get()); | 802 wm::ActivateWindow(unmoved1.get()); |
804 | 803 |
(...skipping 18 matching lines...) Expand all Loading... |
823 // moved1 and its transient parent moved1_trans_parent should have also been | 822 // moved1 and its transient parent moved1_trans_parent should have also been |
824 // copied for displaying on root_windows[1]. | 823 // copied for displaying on root_windows[1]. |
825 aura::Window* copy1 = GetCopyWindow(moved1.get()); | 824 aura::Window* copy1 = GetCopyWindow(moved1.get()); |
826 aura::Window* copy1_trans_parent = GetCopyWindow(moved1_trans_parent.get()); | 825 aura::Window* copy1_trans_parent = GetCopyWindow(moved1_trans_parent.get()); |
827 ASSERT_FALSE(!copy1); | 826 ASSERT_FALSE(!copy1); |
828 ASSERT_FALSE(!copy1_trans_parent); | 827 ASSERT_FALSE(!copy1_trans_parent); |
829 | 828 |
830 // Verify that the bounds and transform of the copy match the original window | 829 // Verify that the bounds and transform of the copy match the original window |
831 // but that it is on the other root window. | 830 // but that it is on the other root window. |
832 EXPECT_EQ(root_windows[1], copy1->GetRootWindow()); | 831 EXPECT_EQ(root_windows[1], copy1->GetRootWindow()); |
833 EXPECT_EQ(moved1->GetBoundsInScreen(), copy1->GetBoundsInScreen()); | 832 EXPECT_EQ(moved1->GetBoundsInScreen().ToString(), |
834 EXPECT_EQ(moved1->layer()->GetTargetTransform(), | 833 copy1->GetBoundsInScreen().ToString()); |
835 copy1->layer()->GetTargetTransform()); | 834 EXPECT_EQ(moved1->layer()->GetTargetTransform().ToString(), |
| 835 copy1->layer()->GetTargetTransform().ToString()); |
836 StopCycling(); | 836 StopCycling(); |
837 | 837 |
838 // After cycling the copy windows should have been destroyed. | 838 // After cycling the copy windows should have been destroyed. |
839 RunAllPendingInMessageLoop(); | 839 RunAllPendingInMessageLoop(); |
840 EXPECT_TRUE(!GetCopyWindow(moved1.get())); | 840 EXPECT_TRUE(!GetCopyWindow(moved1.get())); |
841 EXPECT_TRUE(!GetCopyWindow(moved1_trans_parent.get())); | 841 EXPECT_TRUE(!GetCopyWindow(moved1_trans_parent.get())); |
842 } | 842 } |
843 | 843 |
844 // Tests that beginning to cycle from overview mode moves windows to the | 844 // Tests that beginning to cycle from overview mode moves windows to the |
845 // active display. | 845 // active display. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 ToEnclosingRect(GetTransformedTargetBounds(window1.get())); | 903 ToEnclosingRect(GetTransformedTargetBounds(window1.get())); |
904 EXPECT_EQ(overview_bounds.x(), new_overview_bounds.x()); | 904 EXPECT_EQ(overview_bounds.x(), new_overview_bounds.x()); |
905 EXPECT_EQ(overview_bounds.y(), new_overview_bounds.y()); | 905 EXPECT_EQ(overview_bounds.y(), new_overview_bounds.y()); |
906 EXPECT_EQ(overview_bounds.width(), new_overview_bounds.width()); | 906 EXPECT_EQ(overview_bounds.width(), new_overview_bounds.width()); |
907 EXPECT_EQ(overview_bounds.height(), new_overview_bounds.height()); | 907 EXPECT_EQ(overview_bounds.height(), new_overview_bounds.height()); |
908 StopCycling(); | 908 StopCycling(); |
909 } | 909 } |
910 | 910 |
911 } // namespace internal | 911 } // namespace internal |
912 } // namespace ash | 912 } // namespace ash |
OLD | NEW |