Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: ash/accelerators/accelerator_commands_unittest.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory>
8
7 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
8 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
9 #include "ui/aura/window.h" 11 #include "ui/aura/window.h"
10 12
11 // Note: The unit tests for |ToggleMaximized()| and 13 // Note: The unit tests for |ToggleMaximized()| and
12 // |ToggleFullscreen()| are in 14 // |ToggleFullscreen()| are in
13 // chrome/browser/ui/ash/accelerator_commands_browsertests.cc. 15 // chrome/browser/ui/ash/accelerator_commands_browsertests.cc.
14 // because they depends on chrome implementation of 16 // because they depends on chrome implementation of
15 // |ash::wm::WindowStateDelegate|. 17 // |ash::wm::WindowStateDelegate|.
16 18
17 namespace ash { 19 namespace ash {
18 namespace accelerators { 20 namespace accelerators {
19 21
20 typedef test::AshTestBase AcceleratorCommandsTest; 22 typedef test::AshTestBase AcceleratorCommandsTest;
21 23
22 TEST_F(AcceleratorCommandsTest, ToggleMinimized) { 24 TEST_F(AcceleratorCommandsTest, ToggleMinimized) {
23 scoped_ptr<aura::Window> window1( 25 std::unique_ptr<aura::Window> window1(
24 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); 26 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20)));
25 scoped_ptr<aura::Window> window2( 27 std::unique_ptr<aura::Window> window2(
26 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); 28 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20)));
27 wm::WindowState* window_state1 = wm::GetWindowState(window1.get()); 29 wm::WindowState* window_state1 = wm::GetWindowState(window1.get());
28 wm::WindowState* window_state2 = wm::GetWindowState(window2.get()); 30 wm::WindowState* window_state2 = wm::GetWindowState(window2.get());
29 window_state1->Activate(); 31 window_state1->Activate();
30 window_state2->Activate(); 32 window_state2->Activate();
31 33
32 ToggleMinimized(); 34 ToggleMinimized();
33 EXPECT_TRUE(window_state2->IsMinimized()); 35 EXPECT_TRUE(window_state2->IsMinimized());
34 EXPECT_FALSE(window_state2->IsNormalStateType()); 36 EXPECT_FALSE(window_state2->IsNormalStateType());
35 EXPECT_TRUE(window_state1->IsActive()); 37 EXPECT_TRUE(window_state1->IsActive());
36 38
37 ToggleMinimized(); 39 ToggleMinimized();
38 EXPECT_TRUE(window_state1->IsMinimized()); 40 EXPECT_TRUE(window_state1->IsMinimized());
39 EXPECT_FALSE(window_state1->IsNormalStateType()); 41 EXPECT_FALSE(window_state1->IsNormalStateType());
40 EXPECT_FALSE(window_state1->IsActive()); 42 EXPECT_FALSE(window_state1->IsActive());
41 43
42 // Toggling minimize when there are no active windows should unminimize and 44 // Toggling minimize when there are no active windows should unminimize and
43 // activate the last active window. 45 // activate the last active window.
44 ToggleMinimized(); 46 ToggleMinimized();
45 EXPECT_FALSE(window_state1->IsMinimized()); 47 EXPECT_FALSE(window_state1->IsMinimized());
46 EXPECT_TRUE(window_state1->IsNormalStateType()); 48 EXPECT_TRUE(window_state1->IsNormalStateType());
47 EXPECT_TRUE(window_state1->IsActive()); 49 EXPECT_TRUE(window_state1->IsActive());
48 } 50 }
49 51
50 } // namespace accelerators 52 } // namespace accelerators
51 } // namespace ash 53 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698