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/accelerators/accelerator_commands.h" | 5 #include "ash/accelerators/accelerator_commands.h" |
6 | 6 |
7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_state.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 namespace accelerators { | 12 namespace accelerators { |
13 | 13 |
14 typedef test::AshTestBase AcceleratorCommandsTest; | 14 typedef test::AshTestBase AcceleratorCommandsTest; |
15 | 15 |
16 TEST_F(AcceleratorCommandsTest, ToggleMinimized) { | 16 TEST_F(AcceleratorCommandsTest, ToggleMinimized) { |
17 scoped_ptr<aura::Window> window( | 17 scoped_ptr<aura::Window> window( |
18 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); | 18 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); |
19 wm::ActivateWindow(window.get()); | 19 wm::WindowState* window_state = wm::GetWindowState(window.get()); |
| 20 window_state->Activate(); |
20 | 21 |
21 ToggleMinimized(); | 22 ToggleMinimized(); |
22 EXPECT_TRUE(wm::IsWindowMinimized(window.get())); | 23 EXPECT_TRUE(window_state->IsMinimized()); |
23 EXPECT_FALSE(wm::IsWindowNormal(window.get())); | 24 EXPECT_FALSE(window_state->IsNormalShowState()); |
24 | 25 |
25 ToggleMinimized(); | 26 ToggleMinimized(); |
26 EXPECT_FALSE(wm::IsWindowMinimized(window.get())); | 27 EXPECT_FALSE(window_state->IsMinimized()); |
27 EXPECT_TRUE(wm::IsWindowNormal(window.get())); | 28 EXPECT_TRUE(window_state->IsNormalShowState()); |
28 } | 29 } |
29 | 30 |
30 } // namespace accelerators | 31 } // namespace accelerators |
31 } // namespace ash | 32 } // namespace ash |
OLD | NEW |