OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); | 600 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); |
601 EXPECT_FALSE(resizer->drag_phantom_window_controller_.get()); | 601 EXPECT_FALSE(resizer->drag_phantom_window_controller_.get()); |
602 | 602 |
603 // The window spans both root windows. | 603 // The window spans both root windows. |
604 resizer->Drag(CalculateDragPoint(*resizer, 798, 10), 0); | 604 resizer->Drag(CalculateDragPoint(*resizer, 798, 10), 0); |
605 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); | 605 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); |
606 PhantomWindowController* controller = | 606 PhantomWindowController* controller = |
607 resizer->drag_phantom_window_controller_.get(); | 607 resizer->drag_phantom_window_controller_.get(); |
608 ASSERT_TRUE(controller); | 608 ASSERT_TRUE(controller); |
609 EXPECT_EQ(PhantomWindowController::STYLE_WINDOW, controller->style()); | 609 EXPECT_EQ(PhantomWindowController::STYLE_WINDOW, controller->style()); |
| 610 EXPECT_EQ(resizer->layer_, controller->layer()); |
610 // |window_| should be opaque since the pointer is still on the primary | 611 // |window_| should be opaque since the pointer is still on the primary |
611 // root window. The phantom should be semi-transparent. | 612 // root window. The phantom should be semi-transparent. |
612 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); | 613 EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); |
613 EXPECT_GT(1.0f, controller->GetOpacity()); | 614 EXPECT_GT(1.0f, controller->GetOpacity()); |
614 | 615 |
615 // Enter the pointer to the secondary display. | 616 // Enter the pointer to the secondary display. |
616 resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0); | 617 resizer->Drag(CalculateDragPoint(*resizer, 0, 610), 0); |
617 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); | 618 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); |
618 controller = resizer->drag_phantom_window_controller_.get(); | 619 controller = resizer->drag_phantom_window_controller_.get(); |
619 ASSERT_TRUE(controller); | 620 ASSERT_TRUE(controller); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 ASSERT_TRUE(resizer.get()); | 838 ASSERT_TRUE(resizer.get()); |
838 // Ctrl + drag the window to new poistion by adding (10, 12) to its origin, | 839 // Ctrl + drag the window to new poistion by adding (10, 12) to its origin, |
839 // the window should move to the exact position. | 840 // the window should move to the exact position. |
840 resizer->Drag(CalculateDragPoint(*resizer, 10, 12), 0); | 841 resizer->Drag(CalculateDragPoint(*resizer, 10, 12), 0); |
841 resizer->CompleteDrag(ui::EF_CONTROL_DOWN); | 842 resizer->CompleteDrag(ui::EF_CONTROL_DOWN); |
842 EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); | 843 EXPECT_EQ("106,124 320x160", window_->bounds().ToString()); |
843 } | 844 } |
844 | 845 |
845 } // namespace test | 846 } // namespace test |
846 } // namespace ash | 847 } // namespace ash |
OLD | NEW |