Chromium Code Reviews| 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/panel_layout_manager.h" | 5 #include "ash/wm/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/test/launcher_view_test_api.h" | 12 #include "ash/test/launcher_view_test_api.h" |
| 13 #include "ash/test/test_launcher_delegate.h" | 13 #include "ash/test/test_launcher_delegate.h" |
| 14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "ui/aura/client/aura_constants.h" | |
| 19 #include "ui/aura/test/test_windows.h" | |
| 18 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 19 #include "ui/aura/test/test_windows.h" | |
| 20 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
| 21 | 22 |
| 22 namespace ash { | 23 namespace ash { |
| 23 namespace internal { | 24 namespace internal { |
| 24 | 25 |
| 25 using aura::test::WindowIsAbove; | 26 using aura::test::WindowIsAbove; |
| 26 | 27 |
| 27 class PanelLayoutManagerTest : public ash::test::AshTestBase { | 28 class PanelLayoutManagerTest : public ash::test::AshTestBase { |
| 28 public: | 29 public: |
| 29 PanelLayoutManagerTest() {} | 30 PanelLayoutManagerTest() {} |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 | 254 |
| 254 // At this point, windows should be stacked with 1 < 2 < 3 | 255 // At this point, windows should be stacked with 1 < 2 < 3 |
| 255 wm::ActivateWindow(w2.get()); | 256 wm::ActivateWindow(w2.get()); |
| 256 // Windows should be stacked 1 < 2 > 3 | 257 // Windows should be stacked 1 < 2 > 3 |
| 257 w1.reset(); | 258 w1.reset(); |
| 258 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w2.get())); | 259 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w2.get())); |
| 259 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w3.get())); | 260 EXPECT_NO_FATAL_FAILURE(IsPanelAboveLauncherIcon(w3.get())); |
| 260 EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get())); | 261 EXPECT_TRUE(WindowIsAbove(w2.get(), w3.get())); |
| 261 } | 262 } |
| 262 | 263 |
| 264 TEST_F(PanelLayoutManagerTest, MinimizeRestorePanel) { | |
| 265 gfx::Rect bounds(0, 0, 201, 201); | |
| 266 scoped_ptr<aura::Window> window(CreatePanelWindow(bounds)); | |
| 267 // Activate the window, ensure callout is visible. | |
| 268 wm::ActivateWindow(window.get()); | |
| 269 RunAllPendingInMessageLoop(); | |
| 270 EXPECT_TRUE(IsCalloutVisible()); | |
| 271 // Minimize the panel, callout should be hidden. | |
| 272 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); | |
| 273 RunAllPendingInMessageLoop(); | |
| 274 EXPECT_FALSE(IsCalloutVisible()); | |
| 275 // Restore the pantel; panel should not be activated by default and callout | |
| 276 // should be hidden. | |
| 277 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_NORMAL); | |
| 278 RunAllPendingInMessageLoop(); | |
| 279 EXPECT_FALSE(IsCalloutVisible()); | |
| 280 // Activate the window, ensure callout is visible. | |
| 281 wm::ActivateWindow(window.get()); | |
| 282 RunAllPendingInMessageLoop(); | |
| 283 EXPECT_TRUE(IsCalloutVisible()); | |
| 284 } | |
| 285 | |
|
sky
2012/11/21 00:39:42
nit: remove one of these lines.
stevenjb
2012/11/29 02:30:38
Done.
| |
| 286 | |
| 263 } // namespace internal | 287 } // namespace internal |
| 264 } // namespace ash | 288 } // namespace ash |
| OLD | NEW |