| 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/wm/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/screen_ash.h" | 11 #include "ash/screen_ash.h" |
| 12 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shelf/shelf_widget.h" | 13 #include "ash/shelf/shelf_widget.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
| 16 #include "ash/system/status_area_widget.h" | 16 #include "ash/system/status_area_widget.h" |
| 17 #include "ash/test/ash_test_base.h" | 17 #include "ash/test/ash_test_base.h" |
| 18 #include "ash/test/shell_test_api.h" | 18 #include "ash/test/shell_test_api.h" |
| 19 #include "ash/wm/activation_controller.h" | |
| 20 #include "ash/wm/property_util.h" | 19 #include "ash/wm/property_util.h" |
| 21 #include "ash/wm/window_properties.h" | 20 #include "ash/wm/window_properties.h" |
| 22 #include "ash/wm/window_util.h" | 21 #include "ash/wm/window_util.h" |
| 23 #include "base/command_line.h" | 22 #include "base/command_line.h" |
| 24 #include "base/strings/string_number_conversions.h" | 23 #include "base/strings/string_number_conversions.h" |
| 25 #include "ui/aura/client/aura_constants.h" | 24 #include "ui/aura/client/aura_constants.h" |
| 26 #include "ui/aura/root_window.h" | 25 #include "ui/aura/root_window.h" |
| 27 #include "ui/aura/test/event_generator.h" | 26 #include "ui/aura/test/event_generator.h" |
| 28 #include "ui/aura/test/test_window_delegate.h" | 27 #include "ui/aura/test/test_window_delegate.h" |
| 29 #include "ui/aura/test/test_windows.h" | 28 #include "ui/aura/test/test_windows.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 130 |
| 132 ShelfLayoutManager* shelf_layout_manager() { | 131 ShelfLayoutManager* shelf_layout_manager() { |
| 133 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); | 132 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); |
| 134 } | 133 } |
| 135 | 134 |
| 136 bool GetWindowOverlapsShelf() { | 135 bool GetWindowOverlapsShelf() { |
| 137 return shelf_layout_manager()->window_overlaps_shelf(); | 136 return shelf_layout_manager()->window_overlaps_shelf(); |
| 138 } | 137 } |
| 139 | 138 |
| 140 private: | 139 private: |
| 141 scoped_ptr<ActivationController> activation_controller_; | |
| 142 | |
| 143 DISALLOW_COPY_AND_ASSIGN(WorkspaceControllerTest); | 140 DISALLOW_COPY_AND_ASSIGN(WorkspaceControllerTest); |
| 144 }; | 141 }; |
| 145 | 142 |
| 146 // Assertions around adding a normal window. | 143 // Assertions around adding a normal window. |
| 147 TEST_F(WorkspaceControllerTest, AddNormalWindowWhenEmpty) { | 144 TEST_F(WorkspaceControllerTest, AddNormalWindowWhenEmpty) { |
| 148 scoped_ptr<Window> w1(CreateTestWindow()); | 145 scoped_ptr<Window> w1(CreateTestWindow()); |
| 149 w1->SetBounds(gfx::Rect(0, 0, 250, 251)); | 146 w1->SetBounds(gfx::Rect(0, 0, 250, 251)); |
| 150 | 147 |
| 151 EXPECT_TRUE(GetRestoreBoundsInScreen(w1.get()) == NULL); | 148 EXPECT_TRUE(GetRestoreBoundsInScreen(w1.get()) == NULL); |
| 152 | 149 |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 scoped_ptr<Window> maximized_window(CreateTestWindow()); | 1355 scoped_ptr<Window> maximized_window(CreateTestWindow()); |
| 1359 maximized_window->SetProperty( | 1356 maximized_window->SetProperty( |
| 1360 aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 1357 aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 1361 maximized_window->Show(); | 1358 maximized_window->Show(); |
| 1362 wm::ActivateWindow(maximized_window.get()); | 1359 wm::ActivateWindow(maximized_window.get()); |
| 1363 EXPECT_TRUE(maximized_window->IsVisible()); | 1360 EXPECT_TRUE(maximized_window->IsVisible()); |
| 1364 } | 1361 } |
| 1365 | 1362 |
| 1366 } // namespace internal | 1363 } // namespace internal |
| 1367 } // namespace ash | 1364 } // namespace ash |
| OLD | NEW |