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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 UpdateDisplay(StringPrintf("800x%d", kRootHeight)); | 76 UpdateDisplay(StringPrintf("800x%d", kRootHeight)); |
77 | 77 |
78 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 78 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); |
79 gfx::Rect root_bounds(root->bounds()); | 79 gfx::Rect root_bounds(root->bounds()); |
80 EXPECT_EQ(kRootHeight, root_bounds.height()); | 80 EXPECT_EQ(kRootHeight, root_bounds.height()); |
81 EXPECT_EQ(800, root_bounds.width()); | 81 EXPECT_EQ(800, root_bounds.width()); |
82 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); | 82 Shell::GetInstance()->SetDisplayWorkAreaInsets(root, gfx::Insets()); |
83 window_.reset(new aura::Window(&delegate_)); | 83 window_.reset(new aura::Window(&delegate_)); |
84 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 84 window_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
85 window_->Init(ui::LAYER_NOT_DRAWN); | 85 window_->Init(ui::LAYER_NOT_DRAWN); |
86 window_->SetParent(NULL); | 86 SetDefaultParentByPrimaryRootWindow(window_.get()); |
87 window_->set_id(1); | 87 window_->set_id(1); |
88 | 88 |
89 window2_.reset(new aura::Window(&delegate2_)); | 89 window2_.reset(new aura::Window(&delegate2_)); |
90 window2_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 90 window2_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
91 window2_->Init(ui::LAYER_NOT_DRAWN); | 91 window2_->Init(ui::LAYER_NOT_DRAWN); |
92 window2_->SetParent(NULL); | 92 SetDefaultParentByPrimaryRootWindow(window2_.get()); |
93 window2_->set_id(2); | 93 window2_->set_id(2); |
94 | 94 |
95 window3_.reset(new aura::Window(&delegate3_)); | 95 window3_.reset(new aura::Window(&delegate3_)); |
96 window3_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 96 window3_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
97 window3_->Init(ui::LAYER_NOT_DRAWN); | 97 window3_->Init(ui::LAYER_NOT_DRAWN); |
98 window3_->SetParent(NULL); | 98 SetDefaultParentByPrimaryRootWindow(window3_.get()); |
99 window3_->set_id(3); | 99 window3_->set_id(3); |
100 } | 100 } |
101 | 101 |
102 virtual void TearDown() OVERRIDE { | 102 virtual void TearDown() OVERRIDE { |
103 window_.reset(); | 103 window_.reset(); |
104 window2_.reset(); | 104 window2_.reset(); |
105 window3_.reset(); | 105 window3_.reset(); |
106 AshTestBase::TearDown(); | 106 AshTestBase::TearDown(); |
107 } | 107 } |
108 | 108 |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 | 1518 |
1519 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( | 1519 scoped_ptr<WorkspaceWindowResizer> resizer(WorkspaceWindowResizer::Create( |
1520 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); | 1520 window_.get(), gfx::Point(), HTCAPTION, empty_windows())); |
1521 resizer->Drag(CalculateDragPoint(*resizer, 801, 0), 0); | 1521 resizer->Drag(CalculateDragPoint(*resizer, 801, 0), 0); |
1522 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); | 1522 EXPECT_FALSE(resizer->snap_phantom_window_controller_.get()); |
1523 } | 1523 } |
1524 } | 1524 } |
1525 | 1525 |
1526 } // namespace internal | 1526 } // namespace internal |
1527 } // namespace ash | 1527 } // namespace ash |
OLD | NEW |