blob: 81a3e62a5e7bd952531508743bf2fbc426487303 [file] [log] [blame]
[email protected]f1853122012-06-27 16:21:261// 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
3// found in the LICENSE file.
4
[email protected]8674b312012-10-12 19:02:445#include "ash/root_window_controller.h"
6
[email protected]2e236a52012-06-27 22:21:477#include "ash/display/display_controller.h"
[email protected]fcb123d2013-04-17 15:58:498#include "ash/session_state_delegate.h"
[email protected]478c6c32013-03-09 02:50:589#include "ash/shelf/shelf_layout_manager.h"
[email protected]f1853122012-06-27 16:21:2610#include "ash/shell.h"
11#include "ash/shell_window_ids.h"
[email protected]8674b312012-10-12 19:02:4412#include "ash/system/tray/system_tray_delegate.h"
[email protected]f1853122012-06-27 16:21:2613#include "ash/test/ash_test_base.h"
[email protected]8674b312012-10-12 19:02:4414#include "ash/wm/system_modal_container_layout_manager.h"
[email protected]2ee2f5d2013-01-10 23:37:1615#include "ash/wm/window_properties.h"
[email protected]f1853122012-06-27 16:21:2616#include "ash/wm/window_util.h"
[email protected]792b9b12012-12-11 03:53:2717#include "ui/aura/client/focus_change_observer.h"
[email protected]8cfb6722012-11-28 03:28:4618#include "ui/aura/client/focus_client.h"
[email protected]f1853122012-06-27 16:21:2619#include "ui/aura/env.h"
20#include "ui/aura/root_window.h"
21#include "ui/aura/test/event_generator.h"
[email protected]dbf835d82012-09-11 18:23:0922#include "ui/aura/test/test_window_delegate.h"
23#include "ui/aura/test/test_windows.h"
[email protected]f1853122012-06-27 16:21:2624#include "ui/aura/window.h"
[email protected]dbf835d82012-09-11 18:23:0925#include "ui/aura/window_tracker.h"
[email protected]f1853122012-06-27 16:21:2626#include "ui/views/controls/menu/menu_controller.h"
27#include "ui/views/widget/widget.h"
28#include "ui/views/widget/widget_delegate.h"
29
[email protected]2ee2f5d2013-01-10 23:37:1630using aura::Window;
31using views::Widget;
32
[email protected]f1853122012-06-27 16:21:2633namespace ash {
34namespace {
35
36class TestDelegate : public views::WidgetDelegateView {
37 public:
38 explicit TestDelegate(bool system_modal) : system_modal_(system_modal) {}
39 virtual ~TestDelegate() {}
40
41 // Overridden from views::WidgetDelegate:
42 virtual views::View* GetContentsView() OVERRIDE {
43 return this;
44 }
45
46 virtual ui::ModalType GetModalType() const OVERRIDE {
47 return system_modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE;
48 }
49
50 private:
51 bool system_modal_;
52 DISALLOW_COPY_AND_ASSIGN(TestDelegate);
53};
54
[email protected]792b9b12012-12-11 03:53:2755class DeleteOnBlurDelegate : public aura::test::TestWindowDelegate,
56 public aura::client::FocusChangeObserver {
[email protected]dbf835d82012-09-11 18:23:0957 public:
58 DeleteOnBlurDelegate() : window_(NULL) {}
59 virtual ~DeleteOnBlurDelegate() {}
60
[email protected]792b9b12012-12-11 03:53:2761 void SetWindow(aura::Window* window) {
62 window_ = window;
63 aura::client::SetFocusChangeObserver(window_, this);
64 }
[email protected]dbf835d82012-09-11 18:23:0965
[email protected]869f6352012-12-06 20:47:1766 private:
[email protected]dbf835d82012-09-11 18:23:0967 // aura::test::TestWindowDelegate overrides:
68 virtual bool CanFocus() OVERRIDE {
69 return true;
70 }
[email protected]dbf835d82012-09-11 18:23:0971
[email protected]792b9b12012-12-11 03:53:2772 // aura::client::FocusChangeObserver implementation:
73 virtual void OnWindowFocused(aura::Window* gained_focus,
74 aura::Window* lost_focus) OVERRIDE {
75 if (window_ == lost_focus)
76 delete window_;
[email protected]869f6352012-12-06 20:47:1777 }
78
[email protected]dbf835d82012-09-11 18:23:0979 aura::Window* window_;
80
81 DISALLOW_COPY_AND_ASSIGN(DeleteOnBlurDelegate);
82};
83
[email protected]f1853122012-06-27 16:21:2684} // namespace
85
86namespace test {
[email protected]f1853122012-06-27 16:21:2687
[email protected]a2e6af12013-01-07 21:40:3588class RootWindowControllerTest : public test::AshTestBase {
89 public:
90 views::Widget* CreateTestWidget(const gfx::Rect& bounds) {
91 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
92 NULL, CurrentContext(), bounds);
93 widget->Show();
94 return widget;
95 }
96
97 views::Widget* CreateModalWidget(const gfx::Rect& bounds) {
98 views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
99 new TestDelegate(true), CurrentContext(), bounds);
100 widget->Show();
101 return widget;
102 }
103
104 views::Widget* CreateModalWidgetWithParent(const gfx::Rect& bounds,
105 gfx::NativeWindow parent) {
106 views::Widget* widget =
107 views::Widget::CreateWindowWithParentAndBounds(new TestDelegate(true),
108 parent,
109 bounds);
110 widget->Show();
111 return widget;
112 }
113
114 aura::Window* GetModalContainer(aura::RootWindow* root_window) {
115 return Shell::GetContainer(
116 root_window,
117 ash::internal::kShellWindowId_SystemModalContainer);
118 }
119};
[email protected]f1853122012-06-27 16:21:26120
[email protected]e75642a2013-06-12 17:21:18121TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
122 if (!SupportsMultipleDisplays())
123 return;
[email protected]1c3f7002013-01-21 18:46:05124
[email protected]f634dd32012-07-23 22:49:07125 UpdateDisplay("600x600,500x500");
[email protected]f1853122012-06-27 16:21:26126 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
[email protected]431552c2012-10-23 00:38:33127 internal::RootWindowController* controller =
128 Shell::GetPrimaryRootWindowController();
[email protected]478c6c32013-03-09 02:50:58129 internal::ShelfLayoutManager* shelf_layout_manager =
130 controller->GetShelfLayoutManager();
131 shelf_layout_manager->SetAutoHideBehavior(
132 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
[email protected]f1853122012-06-27 16:21:26133
134 views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100));
135 EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow());
[email protected]e2f64d102012-07-19 19:17:04136 EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString());
[email protected]8d625fb2012-07-18 16:40:06137 EXPECT_EQ("50,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04138 normal->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]f1853122012-06-27 16:21:26139
140 views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100));
141 maximized->Maximize();
142 EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow());
[email protected]8c0ec432013-05-10 04:33:39143 EXPECT_EQ("600,0 500x452", maximized->GetWindowBoundsInScreen().ToString());
144 EXPECT_EQ("0,0 500x452",
145 maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]f1853122012-06-27 16:21:26146
147 views::Widget* minimized = CreateTestWidget(gfx::Rect(800, 10, 100, 100));
148 minimized->Minimize();
149 EXPECT_EQ(root_windows[1], minimized->GetNativeView()->GetRootWindow());
[email protected]8d625fb2012-07-18 16:40:06150 EXPECT_EQ("800,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04151 minimized->GetWindowBoundsInScreen().ToString());
[email protected]f1853122012-06-27 16:21:26152
153 views::Widget* fullscreen = CreateTestWidget(gfx::Rect(900, 10, 100, 100));
154 fullscreen->SetFullscreen(true);
155 EXPECT_EQ(root_windows[1], fullscreen->GetNativeView()->GetRootWindow());
[email protected]1a015382012-12-01 19:44:59156
[email protected]8d625fb2012-07-18 16:40:06157 EXPECT_EQ("600,0 500x500",
[email protected]e2f64d102012-07-19 19:17:04158 fullscreen->GetWindowBoundsInScreen().ToString());
[email protected]8d625fb2012-07-18 16:40:06159 EXPECT_EQ("0,0 500x500",
[email protected]e2f64d102012-07-19 19:17:04160 fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]f1853122012-06-27 16:21:26161
[email protected]8f2f151412013-01-26 03:58:37162 views::Widget* unparented_control = new Widget;
163 Widget::InitParams params;
164 params.bounds = gfx::Rect(650, 10, 100, 100);
165 params.context = CurrentContext();
166 params.type = Widget::InitParams::TYPE_CONTROL;
167 unparented_control->Init(params);
168 EXPECT_EQ(root_windows[1],
169 unparented_control->GetNativeView()->GetRootWindow());
170 EXPECT_EQ(internal::kShellWindowId_UnparentedControlContainer,
171 unparented_control->GetNativeView()->parent()->id());
172
[email protected]95db9c12013-01-31 11:47:44173 aura::Window* panel = CreateTestWindowInShellWithDelegateAndType(
174 NULL, aura::client::WINDOW_TYPE_PANEL, 0, gfx::Rect(700, 100, 100, 100));
175 EXPECT_EQ(root_windows[1], panel->GetRootWindow());
176 EXPECT_EQ(internal::kShellWindowId_PanelContainer, panel->parent()->id());
177
[email protected]dbf835d82012-09-11 18:23:09178 // Make sure a window that will delete itself when losing focus
179 // will not crash.
180 aura::WindowTracker tracker;
181 DeleteOnBlurDelegate delete_on_blur_delegate;
[email protected]5ebe6102012-11-28 21:00:03182 aura::Window* d2 = CreateTestWindowInShellWithDelegate(
183 &delete_on_blur_delegate, 0, gfx::Rect(50, 50, 100, 100));
[email protected]792b9b12012-12-11 03:53:27184 delete_on_blur_delegate.SetWindow(d2);
[email protected]550543e2013-01-11 22:43:44185 aura::client::GetFocusClient(root_windows[0])->FocusWindow(d2);
[email protected]dbf835d82012-09-11 18:23:09186 tracker.Add(d2);
187
[email protected]f634dd32012-07-23 22:49:07188 UpdateDisplay("600x600");
[email protected]f1853122012-06-27 16:21:26189
[email protected]dbf835d82012-09-11 18:23:09190 // d2 must have been deleted.
191 EXPECT_FALSE(tracker.Contains(d2));
192
[email protected]f1853122012-06-27 16:21:26193 EXPECT_EQ(root_windows[0], normal->GetNativeView()->GetRootWindow());
[email protected]e2f64d102012-07-19 19:17:04194 EXPECT_EQ("50,10 100x100", normal->GetWindowBoundsInScreen().ToString());
[email protected]8d625fb2012-07-18 16:40:06195 EXPECT_EQ("50,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04196 normal->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]f1853122012-06-27 16:21:26197
[email protected]eefd51b22012-09-25 20:26:24198 // Maximized area on primary display has 3px (given as
[email protected]f1853122012-06-27 16:21:26199 // kAutoHideSize in shelf_layout_manager.cc) inset at the bottom.
200 EXPECT_EQ(root_windows[0], maximized->GetNativeView()->GetRootWindow());
[email protected]7b675df612012-09-16 18:33:20201 EXPECT_EQ("0,0 600x597",
[email protected]e2f64d102012-07-19 19:17:04202 maximized->GetWindowBoundsInScreen().ToString());
[email protected]7b675df612012-09-16 18:33:20203 EXPECT_EQ("0,0 600x597",
[email protected]e2f64d102012-07-19 19:17:04204 maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]f1853122012-06-27 16:21:26205
206 EXPECT_EQ(root_windows[0], minimized->GetNativeView()->GetRootWindow());
[email protected]8d625fb2012-07-18 16:40:06207 EXPECT_EQ("200,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04208 minimized->GetWindowBoundsInScreen().ToString());
[email protected]f1853122012-06-27 16:21:26209
210 EXPECT_EQ(root_windows[0], fullscreen->GetNativeView()->GetRootWindow());
211 EXPECT_TRUE(fullscreen->IsFullscreen());
[email protected]8d625fb2012-07-18 16:40:06212 EXPECT_EQ("0,0 600x600",
[email protected]e2f64d102012-07-19 19:17:04213 fullscreen->GetWindowBoundsInScreen().ToString());
[email protected]8d625fb2012-07-18 16:40:06214 EXPECT_EQ("0,0 600x600",
[email protected]e2f64d102012-07-19 19:17:04215 fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]8d625fb2012-07-18 16:40:06216
217 // Test if the restore bounds are correctly updated.
218 wm::RestoreWindow(maximized->GetNativeView());
[email protected]e2f64d102012-07-19 19:17:04219 EXPECT_EQ("100,10 100x100", maximized->GetWindowBoundsInScreen().ToString());
[email protected]8d625fb2012-07-18 16:40:06220 EXPECT_EQ("100,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04221 maximized->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]8d625fb2012-07-18 16:40:06222
223 fullscreen->SetFullscreen(false);
224 EXPECT_EQ("300,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04225 fullscreen->GetWindowBoundsInScreen().ToString());
[email protected]8d625fb2012-07-18 16:40:06226 EXPECT_EQ("300,10 100x100",
[email protected]e2f64d102012-07-19 19:17:04227 fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString());
[email protected]8f2f151412013-01-26 03:58:37228
229 // Test if the unparented widget has moved.
230 EXPECT_EQ(root_windows[0],
231 unparented_control->GetNativeView()->GetRootWindow());
232 EXPECT_EQ(internal::kShellWindowId_UnparentedControlContainer,
233 unparented_control->GetNativeView()->parent()->id());
[email protected]95db9c12013-01-31 11:47:44234
235 // Test if the panel has moved.
236 EXPECT_EQ(root_windows[0], panel->GetRootWindow());
237 EXPECT_EQ(internal::kShellWindowId_PanelContainer, panel->parent()->id());
[email protected]f1853122012-06-27 16:21:26238}
239
[email protected]e75642a2013-06-12 17:21:18240TEST_F(RootWindowControllerTest, MoveWindows_Modal) {
241 if (!SupportsMultipleDisplays())
242 return;
[email protected]1c3f7002013-01-21 18:46:05243
[email protected]f634dd32012-07-23 22:49:07244 UpdateDisplay("500x500,500x500");
[email protected]f1853122012-06-27 16:21:26245
246 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
247 // Emulate virtual screen coordinate system.
248 root_windows[0]->SetBounds(gfx::Rect(0, 0, 500, 500));
249 root_windows[1]->SetBounds(gfx::Rect(500, 0, 500, 500));
250
251 views::Widget* normal = CreateTestWidget(gfx::Rect(300, 10, 100, 100));
252 EXPECT_EQ(root_windows[0], normal->GetNativeView()->GetRootWindow());
253 EXPECT_TRUE(wm::IsActiveWindow(normal->GetNativeView()));
254
255 views::Widget* modal = CreateModalWidget(gfx::Rect(650, 10, 100, 100));
256 EXPECT_EQ(root_windows[1], modal->GetNativeView()->GetRootWindow());
257 EXPECT_TRUE(GetModalContainer(root_windows[1])->Contains(
258 modal->GetNativeView()));
259 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView()));
260
261 aura::test::EventGenerator generator_1st(root_windows[0]);
262 generator_1st.ClickLeftButton();
263 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView()));
264
[email protected]f634dd32012-07-23 22:49:07265 UpdateDisplay("500x500");
[email protected]f1853122012-06-27 16:21:26266 EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow());
267 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView()));
268 generator_1st.ClickLeftButton();
269 EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView()));
270}
271
[email protected]8674b312012-10-12 19:02:44272TEST_F(RootWindowControllerTest, ModalContainer) {
273 UpdateDisplay("600x600");
274 Shell* shell = Shell::GetInstance();
275 internal::RootWindowController* controller =
276 shell->GetPrimaryRootWindowController();
277 EXPECT_EQ(user::LOGGED_IN_USER,
[email protected]945f9cae2012-12-12 09:54:29278 shell->system_tray_delegate()->GetUserLoginStatus());
[email protected]8674b312012-10-12 19:02:44279 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
280 internal::kShellWindowId_SystemModalContainer)->layout_manager(),
281 controller->GetSystemModalLayoutManager(NULL));
282
[email protected]3b162e12012-11-09 11:52:35283 views::Widget* session_modal_widget =
284 CreateModalWidget(gfx::Rect(300, 10, 100, 100));
285 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
286 internal::kShellWindowId_SystemModalContainer)->layout_manager(),
287 controller->GetSystemModalLayoutManager(
288 session_modal_widget->GetNativeView()));
289
[email protected]fcb123d2013-04-17 15:58:49290 shell->session_state_delegate()->LockScreen();
[email protected]8674b312012-10-12 19:02:44291 EXPECT_EQ(user::LOGGED_IN_LOCKED,
[email protected]945f9cae2012-12-12 09:54:29292 shell->system_tray_delegate()->GetUserLoginStatus());
[email protected]8674b312012-10-12 19:02:44293 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
294 internal::kShellWindowId_LockSystemModalContainer)->layout_manager(),
295 controller->GetSystemModalLayoutManager(NULL));
[email protected]3b162e12012-11-09 11:52:35296
297 aura::Window* lock_container =
298 Shell::GetContainer(controller->root_window(),
299 internal::kShellWindowId_LockScreenContainer);
300 views::Widget* lock_modal_widget =
301 CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container);
302 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
303 internal::kShellWindowId_LockSystemModalContainer)->layout_manager(),
304 controller->GetSystemModalLayoutManager(
305 lock_modal_widget->GetNativeView()));
306 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
307 internal::kShellWindowId_SystemModalContainer)->layout_manager(),
308 controller->GetSystemModalLayoutManager(
309 session_modal_widget->GetNativeView()));
310
[email protected]fcb123d2013-04-17 15:58:49311 shell->session_state_delegate()->UnlockScreen();
[email protected]8674b312012-10-12 19:02:44312}
313
[email protected]1b219922012-11-13 21:16:43314TEST_F(RootWindowControllerTest, ModalContainerNotLoggedInLoggedIn) {
315 UpdateDisplay("600x600");
316 Shell* shell = Shell::GetInstance();
317
318 // Configure login screen environment.
319 SetUserLoggedIn(false);
320 EXPECT_EQ(user::LOGGED_IN_NONE,
[email protected]945f9cae2012-12-12 09:54:29321 shell->system_tray_delegate()->GetUserLoginStatus());
[email protected]c8d19f82013-05-18 09:09:41322 EXPECT_EQ(0, shell->session_state_delegate()->NumberOfLoggedInUsers());
[email protected]fcb123d2013-04-17 15:58:49323 EXPECT_FALSE(shell->session_state_delegate()->IsActiveUserSessionStarted());
[email protected]1b219922012-11-13 21:16:43324
325 internal::RootWindowController* controller =
326 shell->GetPrimaryRootWindowController();
327 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
328 internal::kShellWindowId_LockSystemModalContainer)->layout_manager(),
329 controller->GetSystemModalLayoutManager(NULL));
330
331 aura::Window* lock_container =
332 Shell::GetContainer(controller->root_window(),
333 internal::kShellWindowId_LockScreenContainer);
334 views::Widget* login_modal_widget =
335 CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container);
336 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
337 internal::kShellWindowId_LockSystemModalContainer)->layout_manager(),
338 controller->GetSystemModalLayoutManager(
339 login_modal_widget->GetNativeView()));
340 login_modal_widget->Close();
341
342 // Configure user session environment.
343 SetUserLoggedIn(true);
344 SetSessionStarted(true);
345 EXPECT_EQ(user::LOGGED_IN_USER,
[email protected]945f9cae2012-12-12 09:54:29346 shell->system_tray_delegate()->GetUserLoginStatus());
[email protected]c8d19f82013-05-18 09:09:41347 EXPECT_EQ(1, shell->session_state_delegate()->NumberOfLoggedInUsers());
[email protected]fcb123d2013-04-17 15:58:49348 EXPECT_TRUE(shell->session_state_delegate()->IsActiveUserSessionStarted());
[email protected]1b219922012-11-13 21:16:43349 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
350 internal::kShellWindowId_SystemModalContainer)->layout_manager(),
351 controller->GetSystemModalLayoutManager(NULL));
352
353 views::Widget* session_modal_widget =
354 CreateModalWidget(gfx::Rect(300, 10, 100, 100));
355 EXPECT_EQ(Shell::GetContainer(controller->root_window(),
356 internal::kShellWindowId_SystemModalContainer)->layout_manager(),
357 controller->GetSystemModalLayoutManager(
358 session_modal_widget->GetNativeView()));
359}
360
[email protected]700849f2013-04-30 17:49:20361// Test that GetFullscreenWindow() returns a fullscreen window only if the
362// fullscreen window is in the active workspace.
363TEST_F(RootWindowControllerTest, GetFullscreenWindow) {
[email protected]2ee2f5d2013-01-10 23:37:16364 UpdateDisplay("600x600");
365 internal::RootWindowController* controller =
366 Shell::GetInstance()->GetPrimaryRootWindowController();
367
[email protected]700849f2013-04-30 17:49:20368 Widget* w1 = CreateTestWidget(gfx::Rect(0, 0, 100, 100));
[email protected]2ee2f5d2013-01-10 23:37:16369 w1->Maximize();
[email protected]700849f2013-04-30 17:49:20370 Widget* w2 = CreateTestWidget(gfx::Rect(0, 0, 100, 100));
371 w2->SetFullscreen(true);
372 // |w3| is a transient child of |w2|.
373 Widget* w3 = Widget::CreateWindowWithParentAndBounds(NULL,
374 w2->GetNativeWindow(), gfx::Rect(0, 0, 100, 100));
[email protected]2ee2f5d2013-01-10 23:37:16375
[email protected]700849f2013-04-30 17:49:20376 // Test that GetFullscreenWindow() finds the fullscreen window when one of
377 // its transient children is active.
378 w3->Activate();
379 EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow());
[email protected]2ee2f5d2013-01-10 23:37:16380
[email protected]700849f2013-04-30 17:49:20381 // Activate the maximized window's workspace. GetFullscreenWindow() should
382 // fail because the fullscreen window's workspace is no longer active.
383 w1->Activate();
384 EXPECT_FALSE(controller->GetFullscreenWindow());
[email protected]2ee2f5d2013-01-10 23:37:16385
[email protected]700849f2013-04-30 17:49:20386 // If the fullscreen window is active, GetFullscreenWindow() should find it.
387 w2->Activate();
388 EXPECT_EQ(w2->GetNativeWindow(), controller->GetFullscreenWindow());
[email protected]2ee2f5d2013-01-10 23:37:16389}
390
[email protected]f1853122012-06-27 16:21:26391} // namespace test
392} // namespace ash