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 3 // found in the LICENSE file. 4 5 #include "ash/accelerators/accelerator_commands.h" 6 7 #include "ash/test/ash_test_base.h" 8 #include "ash/wm/window_state.h" 9 #include "ui/aura/window.h" 10 11 // Note: The unit tests for |ToggleMaximized()| and 12 // |ToggleFullscreen()| are in 13 // chrome/browser/ui/ash/accelerator_commands_browsertests.cc. 14 // because they depends on chrome implementation of 15 // |ash::wm::WindowStateDelegate|. 16 17 namespace ash { 18 namespace accelerators { 19 20 typedef test::AshTestBase AcceleratorCommandsTest; 21 22 TEST_F(AcceleratorCommandsTest, ToggleMinimized) { 23 scoped_ptr<aura::Window> window( 24 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); 25 wm::WindowState* window_state = wm::GetWindowState(window.get()); 26 window_state->Activate(); 27 28 ToggleMinimized(); 29 EXPECT_TRUE(window_state->IsMinimized()); 30 EXPECT_FALSE(window_state->IsNormalShowState()); 31 32 ToggleMinimized(); 33 EXPECT_FALSE(window_state->IsMinimized()); 34 EXPECT_TRUE(window_state->IsNormalShowState()); 35 } 36 37 } // namespace accelerators 38 } // namespace ash 39