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

Side by Side Diff: ash/wm/ash_focus_rules_unittest.cc

Issue 2542493002: Replace kCanMaximize/Minimize/Resize with kResizeBehavior. (Closed)
Patch Set: Fix int->bool compile issue. Created 4 years 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 | « ash/test/ash_test_base.cc ('k') | ash/wm/dock/docked_window_layout_manager_unittest.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/common/session/session_state_delegate.h" 5 #include "ash/common/session/session_state_delegate.h"
6 #include "ash/common/test/test_session_state_delegate.h" 6 #include "ash/common/test/test_session_state_delegate.h"
7 #include "ash/common/wm/window_state.h" 7 #include "ash/common/wm/window_state.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/test/ash_test_helper.h" 12 #include "ash/test/ash_test_helper.h"
13 #include "ash/test/test_shell_delegate.h" 13 #include "ash/test/test_shell_delegate.h"
14 #include "ash/wm/lock_state_controller.h" 14 #include "ash/wm/lock_state_controller.h"
15 #include "ash/wm/window_state_aura.h" 15 #include "ash/wm/window_state_aura.h"
16 #include "ash/wm/window_util.h" 16 #include "ash/wm/window_util.h"
17 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
17 #include "ui/aura/client/aura_constants.h" 18 #include "ui/aura/client/aura_constants.h"
18 #include "ui/aura/client/window_parenting_client.h" 19 #include "ui/aura/client/window_parenting_client.h"
19 #include "ui/views/test/widget_test.h" 20 #include "ui/views/test/widget_test.h"
20 #include "ui/views/view.h" 21 #include "ui/views/view.h"
21 #include "ui/views/widget/widget.h" 22 #include "ui/views/widget/widget.h"
22 23
23 namespace ash { 24 namespace ash {
24 namespace test { 25 namespace test {
25 26
26 namespace { 27 namespace {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 aura::Window* container = Shell::GetContainer(root_window, container_id); 126 aura::Window* container = Shell::GetContainer(root_window, container_id);
126 aura::Window* window = new aura::Window(nullptr); 127 aura::Window* window = new aura::Window(nullptr);
127 window->set_id(0); 128 window->set_id(0);
128 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); 129 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
129 window->Init(ui::LAYER_TEXTURED); 130 window->Init(ui::LAYER_TEXTURED);
130 window->Show(); 131 window->Show();
131 132
132 aura::client::ParentWindowWithContext(window, container, 133 aura::client::ParentWindowWithContext(window, container,
133 gfx::Rect(0, 0, 400, 400)); 134 gfx::Rect(0, 0, 400, 400));
134 135
135 window->SetProperty(aura::client::kCanMaximizeKey, true); 136 window->SetProperty(aura::client::kResizeBehaviorKey,
136 window->SetProperty(aura::client::kCanMinimizeKey, true); 137 ui::mojom::kResizeBehaviorCanMaximize |
138 ui::mojom::kResizeBehaviorCanMinimize |
139 ui::mojom::kResizeBehaviorCanResize);
137 return window; 140 return window;
138 } 141 }
139 142
140 DISALLOW_COPY_AND_ASSIGN(LockScreenAshFocusRulesTest); 143 DISALLOW_COPY_AND_ASSIGN(LockScreenAshFocusRulesTest);
141 }; 144 };
142 145
143 } // namespace 146 } // namespace
144 147
145 // Verifies focus is returned (after unlocking the screen) to the most recent 148 // Verifies focus is returned (after unlocking the screen) to the most recent
146 // window that had it before locking the screen. 149 // window that had it before locking the screen.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 EXPECT_FALSE(delegate.view()->HasFocus()); 203 EXPECT_FALSE(delegate.view()->HasFocus());
201 204
202 UnblockUserSession(); 205 UnblockUserSession();
203 EXPECT_FALSE(WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked()); 206 EXPECT_FALSE(WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked());
204 EXPECT_TRUE(delegate.GetWidget()->IsActive()); 207 EXPECT_TRUE(delegate.GetWidget()->IsActive());
205 EXPECT_TRUE(delegate.view()->HasFocus()); 208 EXPECT_TRUE(delegate.view()->HasFocus());
206 } 209 }
207 210
208 } // namespace test 211 } // namespace test
209 } // namespace ash 212 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/wm/dock/docked_window_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698