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/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/mouse_cursor_event_filter.h" | 8 #include "ash/display/mouse_cursor_event_filter.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/screen_ash.h" | 10 #include "ash/screen_ash.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 UpdateDisplay(StringPrintf("800x%d", kRootHeight)); | 67 UpdateDisplay(StringPrintf("800x%d", kRootHeight)); |
68 | 68 |
69 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 69 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); |
70 gfx::Rect root_bounds(root->bounds()); | 70 gfx::Rect root_bounds(root->bounds()); |
71 EXPECT_EQ(kRootHeight, root_bounds.height()); | 71 EXPECT_EQ(kRootHeight, root_bounds.height()); |
72 EXPECT_EQ(800, root_bounds.width()); | 72 EXPECT_EQ(800, root_bounds.width()); |
73 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); | 73 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
74 window_.reset(new aura::Window(&delegate_)); | 74 window_.reset(new aura::Window(&delegate_)); |
75 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 75 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
76 window_->Init(ui::LAYER_NOT_DRAWN); | 76 window_->Init(ui::LAYER_NOT_DRAWN); |
77 window_->SetParent(NULL); | 77 AddToRootWindow(window_.get()); |
78 window_->set_id(1); | 78 window_->set_id(1); |
79 | 79 |
80 window2_.reset(new aura::Window(&delegate2_)); | 80 window2_.reset(new aura::Window(&delegate2_)); |
81 window2_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 81 window2_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
82 window2_->Init(ui::LAYER_NOT_DRAWN); | 82 window2_->Init(ui::LAYER_NOT_DRAWN); |
83 window2_->SetParent(NULL); | 83 AddToRootWindow(window2_.get()); |
84 window2_->set_id(2); | 84 window2_->set_id(2); |
85 | 85 |
86 window3_.reset(new aura::Window(&delegate3_)); | 86 window3_.reset(new aura::Window(&delegate3_)); |
87 window3_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 87 window3_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
88 window3_->Init(ui::LAYER_NOT_DRAWN); | 88 window3_->Init(ui::LAYER_NOT_DRAWN); |
89 window3_->SetParent(NULL); | 89 AddToRootWindow(window3_.get()); |
90 window3_->set_id(3); | 90 window3_->set_id(3); |
91 } | 91 } |
92 | 92 |
93 virtual void TearDown() OVERRIDE { | 93 virtual void TearDown() OVERRIDE { |
94 window_.reset(); | 94 window_.reset(); |
95 window2_.reset(); | 95 window2_.reset(); |
96 window3_.reset(); | 96 window3_.reset(); |
97 AshTestBase::TearDown(); | 97 AshTestBase::TearDown(); |
98 } | 98 } |
99 | 99 |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 // Move it 100 to the bottom. | 1460 // Move it 100 to the bottom. |
1461 resizer->Drag(CalculateDragPoint(*resizer, 0, 100), 0); | 1461 resizer->Drag(CalculateDragPoint(*resizer, 0, 100), 0); |
1462 EXPECT_EQ("0,150 400x200", window_->bounds().ToString()); | 1462 EXPECT_EQ("0,150 400x200", window_->bounds().ToString()); |
1463 resizer->CompleteDrag(0); | 1463 resizer->CompleteDrag(0); |
1464 EXPECT_TRUE(ash::wm::HasUserChangedWindowPositionOrSize(window_.get())); | 1464 EXPECT_TRUE(ash::wm::HasUserChangedWindowPositionOrSize(window_.get())); |
1465 } | 1465 } |
1466 } | 1466 } |
1467 | 1467 |
1468 } // namespace internal | 1468 } // namespace internal |
1469 } // namespace ash | 1469 } // namespace ash |
OLD | NEW |