OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura_shell/workspace/workspace_manager.h" | 5 #include "ui/aura_shell/workspace/workspace_manager.h" |
6 | 6 |
7 #include "ui/aura/client/aura_constants.h" | 7 #include "ui/aura/client/aura_constants.h" |
8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/screen_aura.h" | 9 #include "ui/aura/screen_aura.h" |
10 #include "ui/aura/test/aura_test_base.h" | 10 #include "ui/aura/test/aura_test_base.h" |
11 #include "ui/aura/test/test_stacking_client.h" | 11 #include "ui/aura/test/test_stacking_client.h" |
12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
13 #include "ui/aura_shell/workspace/workspace.h" | 13 #include "ui/aura_shell/workspace/workspace.h" |
14 #include "ui/aura_shell/workspace/workspace_observer.h" | 14 #include "ui/aura_shell/workspace/workspace_observer.h" |
15 #include "ui/base/ui_base_types.h" | 15 #include "ui/base/ui_base_types.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 using aura_shell::internal::Workspace; | 18 using aura_shell::internal::Workspace; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 viewport()->AddChild(w1.get()); | 166 viewport()->AddChild(w1.get()); |
167 EXPECT_TRUE(ws1->AddWindowAfter(w1.get(), NULL)); | 167 EXPECT_TRUE(ws1->AddWindowAfter(w1.get(), NULL)); |
168 manager_->SetWorkspaceSize(gfx::Size(50, 50)); | 168 manager_->SetWorkspaceSize(gfx::Size(50, 50)); |
169 | 169 |
170 // ws1 is laied out in left most position. | 170 // ws1 is laied out in left most position. |
171 EXPECT_EQ("0,0 50x50", ws1->bounds().ToString()); | 171 EXPECT_EQ("0,0 50x50", ws1->bounds().ToString()); |
172 EXPECT_EQ("0,0 50x50", w1->layer()->GetTargetBounds().ToString()); | 172 EXPECT_EQ("0,0 50x50", w1->layer()->GetTargetBounds().ToString()); |
173 } | 173 } |
174 | 174 |
175 TEST_F(WorkspaceManagerTest, WorkspaceManagerDragArea) { | 175 TEST_F(WorkspaceManagerTest, WorkspaceManagerDragArea) { |
176 aura::Desktop::GetInstance()->screen()->set_work_area_insets( | 176 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( |
177 gfx::Insets(10, 10, 10, 10)); | 177 gfx::Insets(10, 10, 10, 10)); |
178 viewport()->SetBounds(gfx::Rect(0, 0, 200, 200)); | 178 viewport()->SetBounds(gfx::Rect(0, 0, 200, 200)); |
179 EXPECT_EQ("10,10 180x180", manager_->GetDragAreaBounds().ToString()); | 179 EXPECT_EQ("10,10 180x180", manager_->GetDragAreaBounds().ToString()); |
180 } | 180 } |
181 | 181 |
182 TEST_F(WorkspaceManagerTest, WorkspaceManagerActivate) { | 182 TEST_F(WorkspaceManagerTest, WorkspaceManagerActivate) { |
183 TestWorkspaceObserver observer(manager_.get()); | 183 TestWorkspaceObserver observer(manager_.get()); |
184 Workspace* ws1 = manager_->CreateWorkspace(); | 184 Workspace* ws1 = manager_->CreateWorkspace(); |
185 Workspace* ws2 = manager_->CreateWorkspace(); | 185 Workspace* ws2 = manager_->CreateWorkspace(); |
186 EXPECT_EQ(NULL, manager_->GetActiveWorkspace()); | 186 EXPECT_EQ(NULL, manager_->GetActiveWorkspace()); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 | 549 |
550 w2->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 550 w2->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
551 EXPECT_TRUE(ws->ContainsFullscreenWindow()); | 551 EXPECT_TRUE(ws->ContainsFullscreenWindow()); |
552 | 552 |
553 w2->Hide(); | 553 w2->Hide(); |
554 EXPECT_FALSE(ws->ContainsFullscreenWindow()); | 554 EXPECT_FALSE(ws->ContainsFullscreenWindow()); |
555 } | 555 } |
556 | 556 |
557 } // namespace internal | 557 } // namespace internal |
558 } // namespace aura_shell | 558 } // namespace aura_shell |
OLD | NEW |