[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 1 | // 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] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 5 | #include "ash/root_window_controller.h" |
| 6 | |
[email protected] | 2e236a5 | 2012-06-27 22:21:47 | [diff] [blame] | 7 | #include "ash/display/display_controller.h" |
| 8 | #include "ash/display/multi_display_manager.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 9 | #include "ash/shell.h" |
[email protected] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 10 | #include "ash/shell_delegate.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 11 | #include "ash/shell_window_ids.h" |
[email protected] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 12 | #include "ash/system/tray/system_tray_delegate.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 13 | #include "ash/test/ash_test_base.h" |
[email protected] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 14 | #include "ash/wm/system_modal_container_layout_manager.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 15 | #include "ash/wm/window_util.h" |
| 16 | #include "ui/aura/env.h" |
[email protected] | dbf835d8 | 2012-09-11 18:23:09 | [diff] [blame] | 17 | #include "ui/aura/focus_manager.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 18 | #include "ui/aura/root_window.h" |
| 19 | #include "ui/aura/test/event_generator.h" |
[email protected] | dbf835d8 | 2012-09-11 18:23:09 | [diff] [blame] | 20 | #include "ui/aura/test/test_window_delegate.h" |
| 21 | #include "ui/aura/test/test_windows.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 22 | #include "ui/aura/window.h" |
[email protected] | dbf835d8 | 2012-09-11 18:23:09 | [diff] [blame] | 23 | #include "ui/aura/window_tracker.h" |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 24 | #include "ui/views/controls/menu/menu_controller.h" |
| 25 | #include "ui/views/widget/widget.h" |
| 26 | #include "ui/views/widget/widget_delegate.h" |
| 27 | |
| 28 | namespace ash { |
| 29 | namespace { |
| 30 | |
| 31 | class TestDelegate : public views::WidgetDelegateView { |
| 32 | public: |
| 33 | explicit TestDelegate(bool system_modal) : system_modal_(system_modal) {} |
| 34 | virtual ~TestDelegate() {} |
| 35 | |
| 36 | // Overridden from views::WidgetDelegate: |
| 37 | virtual views::View* GetContentsView() OVERRIDE { |
| 38 | return this; |
| 39 | } |
| 40 | |
| 41 | virtual ui::ModalType GetModalType() const OVERRIDE { |
| 42 | return system_modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE; |
| 43 | } |
| 44 | |
| 45 | private: |
| 46 | bool system_modal_; |
| 47 | DISALLOW_COPY_AND_ASSIGN(TestDelegate); |
| 48 | }; |
| 49 | |
[email protected] | dbf835d8 | 2012-09-11 18:23:09 | [diff] [blame] | 50 | class DeleteOnBlurDelegate : public aura::test::TestWindowDelegate { |
| 51 | public: |
| 52 | DeleteOnBlurDelegate() : window_(NULL) {} |
| 53 | virtual ~DeleteOnBlurDelegate() {} |
| 54 | |
| 55 | void set_window(aura::Window* window) { window_ = window; } |
| 56 | |
| 57 | // aura::test::TestWindowDelegate overrides: |
| 58 | virtual bool CanFocus() OVERRIDE { |
| 59 | return true; |
| 60 | } |
| 61 | virtual void OnBlur() OVERRIDE { |
| 62 | delete window_; |
| 63 | } |
| 64 | |
| 65 | private: |
| 66 | aura::Window* window_; |
| 67 | |
| 68 | DISALLOW_COPY_AND_ASSIGN(DeleteOnBlurDelegate); |
| 69 | }; |
| 70 | |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 71 | views::Widget* CreateTestWidget(const gfx::Rect& bounds) { |
| 72 | views::Widget* widget = |
| 73 | views::Widget::CreateWindowWithBounds(NULL, bounds); |
| 74 | widget->Show(); |
| 75 | return widget; |
| 76 | } |
| 77 | |
| 78 | views::Widget* CreateModalWidget(const gfx::Rect& bounds) { |
| 79 | views::Widget* widget = |
| 80 | views::Widget::CreateWindowWithBounds(new TestDelegate(true), bounds); |
| 81 | widget->Show(); |
| 82 | return widget; |
| 83 | } |
| 84 | |
[email protected] | 3b162e1 | 2012-11-09 11:52:35 | [diff] [blame] | 85 | views::Widget* CreateModalWidgetWithParent(const gfx::Rect& bounds, |
| 86 | gfx::NativeWindow parent) { |
| 87 | views::Widget* widget = |
| 88 | views::Widget::CreateWindowWithParentAndBounds(new TestDelegate(true), |
| 89 | parent, |
| 90 | bounds); |
| 91 | widget->Show(); |
| 92 | return widget; |
| 93 | } |
| 94 | |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 95 | aura::Window* GetModalContainer(aura::RootWindow* root_window) { |
| 96 | return Shell::GetContainer( |
| 97 | root_window, |
| 98 | ash::internal::kShellWindowId_SystemModalContainer); |
| 99 | } |
| 100 | |
| 101 | } // namespace |
| 102 | |
| 103 | namespace test { |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 104 | |
[email protected] | 3e4351b | 2012-08-09 04:04:16 | [diff] [blame] | 105 | typedef test::AshTestBase RootWindowControllerTest; |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 106 | |
| 107 | TEST_F(RootWindowControllerTest, MoveWindows_Basic) { |
[email protected] | f634dd3 | 2012-07-23 22:49:07 | [diff] [blame] | 108 | UpdateDisplay("600x600,500x500"); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 109 | Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
[email protected] | 431552c | 2012-10-23 00:38:33 | [diff] [blame] | 110 | internal::RootWindowController* controller = |
| 111 | Shell::GetPrimaryRootWindowController(); |
| 112 | controller->SetShelfAutoHideBehavior(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 113 | |
| 114 | views::Widget* normal = CreateTestWidget(gfx::Rect(650, 10, 100, 100)); |
| 115 | EXPECT_EQ(root_windows[1], normal->GetNativeView()->GetRootWindow()); |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 116 | EXPECT_EQ("650,10 100x100", normal->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 117 | EXPECT_EQ("50,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 118 | normal->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 119 | |
| 120 | views::Widget* maximized = CreateTestWidget(gfx::Rect(700, 10, 100, 100)); |
| 121 | maximized->Maximize(); |
| 122 | EXPECT_EQ(root_windows[1], maximized->GetNativeView()->GetRootWindow()); |
| 123 | #if !defined(OS_WIN) |
| 124 | // TODO(oshima): Window reports smaller screen size. Investigate why. |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 125 | EXPECT_EQ("600,0 500x500", maximized->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 126 | EXPECT_EQ("0,0 500x500", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 127 | maximized->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 128 | #endif |
| 129 | |
| 130 | views::Widget* minimized = CreateTestWidget(gfx::Rect(800, 10, 100, 100)); |
| 131 | minimized->Minimize(); |
| 132 | EXPECT_EQ(root_windows[1], minimized->GetNativeView()->GetRootWindow()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 133 | EXPECT_EQ("800,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 134 | minimized->GetWindowBoundsInScreen().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 135 | |
| 136 | views::Widget* fullscreen = CreateTestWidget(gfx::Rect(900, 10, 100, 100)); |
| 137 | fullscreen->SetFullscreen(true); |
| 138 | EXPECT_EQ(root_windows[1], fullscreen->GetNativeView()->GetRootWindow()); |
| 139 | #if !defined(OS_WIN) |
| 140 | // TODO(oshima): Window reports smaller screen size. Investigate why. |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 141 | EXPECT_EQ("600,0 500x500", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 142 | fullscreen->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 143 | EXPECT_EQ("0,0 500x500", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 144 | fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 145 | #endif |
| 146 | |
[email protected] | dbf835d8 | 2012-09-11 18:23:09 | [diff] [blame] | 147 | // Make sure a window that will delete itself when losing focus |
| 148 | // will not crash. |
| 149 | aura::WindowTracker tracker; |
| 150 | DeleteOnBlurDelegate delete_on_blur_delegate; |
| 151 | aura::Window* d2 = aura::test::CreateTestWindowWithDelegate( |
| 152 | &delete_on_blur_delegate, 0, gfx::Rect(50, 50, 100, 100), NULL); |
| 153 | delete_on_blur_delegate.set_window(d2); |
| 154 | root_windows[0]->GetFocusManager()->SetFocusedWindow( |
| 155 | d2, NULL); |
| 156 | tracker.Add(d2); |
| 157 | |
[email protected] | f634dd3 | 2012-07-23 22:49:07 | [diff] [blame] | 158 | UpdateDisplay("600x600"); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 159 | |
[email protected] | dbf835d8 | 2012-09-11 18:23:09 | [diff] [blame] | 160 | // d2 must have been deleted. |
| 161 | EXPECT_FALSE(tracker.Contains(d2)); |
| 162 | |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 163 | EXPECT_EQ(root_windows[0], normal->GetNativeView()->GetRootWindow()); |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 164 | EXPECT_EQ("50,10 100x100", normal->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 165 | EXPECT_EQ("50,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 166 | normal->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 167 | |
[email protected] | eefd51b2 | 2012-09-25 20:26:24 | [diff] [blame] | 168 | // Maximized area on primary display has 3px (given as |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 169 | // kAutoHideSize in shelf_layout_manager.cc) inset at the bottom. |
| 170 | EXPECT_EQ(root_windows[0], maximized->GetNativeView()->GetRootWindow()); |
[email protected] | 7b675df61 | 2012-09-16 18:33:20 | [diff] [blame] | 171 | EXPECT_EQ("0,0 600x597", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 172 | maximized->GetWindowBoundsInScreen().ToString()); |
[email protected] | 7b675df61 | 2012-09-16 18:33:20 | [diff] [blame] | 173 | EXPECT_EQ("0,0 600x597", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 174 | maximized->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 175 | |
| 176 | EXPECT_EQ(root_windows[0], minimized->GetNativeView()->GetRootWindow()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 177 | EXPECT_EQ("200,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 178 | minimized->GetWindowBoundsInScreen().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 179 | |
| 180 | EXPECT_EQ(root_windows[0], fullscreen->GetNativeView()->GetRootWindow()); |
| 181 | EXPECT_TRUE(fullscreen->IsFullscreen()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 182 | EXPECT_EQ("0,0 600x600", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 183 | fullscreen->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 184 | EXPECT_EQ("0,0 600x600", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 185 | fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 186 | |
| 187 | // Test if the restore bounds are correctly updated. |
| 188 | wm::RestoreWindow(maximized->GetNativeView()); |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 189 | EXPECT_EQ("100,10 100x100", maximized->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 190 | EXPECT_EQ("100,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 191 | maximized->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 192 | |
| 193 | fullscreen->SetFullscreen(false); |
| 194 | EXPECT_EQ("300,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 195 | fullscreen->GetWindowBoundsInScreen().ToString()); |
[email protected] | 8d625fb | 2012-07-18 16:40:06 | [diff] [blame] | 196 | EXPECT_EQ("300,10 100x100", |
[email protected] | e2f64d10 | 2012-07-19 19:17:04 | [diff] [blame] | 197 | fullscreen->GetNativeView()->GetBoundsInRootWindow().ToString()); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | TEST_F(RootWindowControllerTest, MoveWindows_Modal) { |
[email protected] | f634dd3 | 2012-07-23 22:49:07 | [diff] [blame] | 201 | UpdateDisplay("500x500,500x500"); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 202 | |
| 203 | Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 204 | // Emulate virtual screen coordinate system. |
| 205 | root_windows[0]->SetBounds(gfx::Rect(0, 0, 500, 500)); |
| 206 | root_windows[1]->SetBounds(gfx::Rect(500, 0, 500, 500)); |
| 207 | |
| 208 | views::Widget* normal = CreateTestWidget(gfx::Rect(300, 10, 100, 100)); |
| 209 | EXPECT_EQ(root_windows[0], normal->GetNativeView()->GetRootWindow()); |
| 210 | EXPECT_TRUE(wm::IsActiveWindow(normal->GetNativeView())); |
| 211 | |
| 212 | views::Widget* modal = CreateModalWidget(gfx::Rect(650, 10, 100, 100)); |
| 213 | EXPECT_EQ(root_windows[1], modal->GetNativeView()->GetRootWindow()); |
| 214 | EXPECT_TRUE(GetModalContainer(root_windows[1])->Contains( |
| 215 | modal->GetNativeView())); |
| 216 | EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
| 217 | |
| 218 | aura::test::EventGenerator generator_1st(root_windows[0]); |
| 219 | generator_1st.ClickLeftButton(); |
| 220 | EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
| 221 | |
[email protected] | f634dd3 | 2012-07-23 22:49:07 | [diff] [blame] | 222 | UpdateDisplay("500x500"); |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 223 | EXPECT_EQ(root_windows[0], modal->GetNativeView()->GetRootWindow()); |
| 224 | EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
| 225 | generator_1st.ClickLeftButton(); |
| 226 | EXPECT_TRUE(wm::IsActiveWindow(modal->GetNativeView())); |
| 227 | } |
| 228 | |
[email protected] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 229 | TEST_F(RootWindowControllerTest, ModalContainer) { |
| 230 | UpdateDisplay("600x600"); |
| 231 | Shell* shell = Shell::GetInstance(); |
| 232 | internal::RootWindowController* controller = |
| 233 | shell->GetPrimaryRootWindowController(); |
| 234 | EXPECT_EQ(user::LOGGED_IN_USER, |
| 235 | shell->tray_delegate()->GetUserLoginStatus()); |
| 236 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 237 | internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 238 | controller->GetSystemModalLayoutManager(NULL)); |
| 239 | |
[email protected] | 3b162e1 | 2012-11-09 11:52:35 | [diff] [blame] | 240 | views::Widget* session_modal_widget = |
| 241 | CreateModalWidget(gfx::Rect(300, 10, 100, 100)); |
| 242 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 243 | internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 244 | controller->GetSystemModalLayoutManager( |
| 245 | session_modal_widget->GetNativeView())); |
| 246 | |
[email protected] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 247 | shell->delegate()->LockScreen(); |
| 248 | EXPECT_EQ(user::LOGGED_IN_LOCKED, |
| 249 | shell->tray_delegate()->GetUserLoginStatus()); |
| 250 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 251 | internal::kShellWindowId_LockSystemModalContainer)->layout_manager(), |
| 252 | controller->GetSystemModalLayoutManager(NULL)); |
[email protected] | 3b162e1 | 2012-11-09 11:52:35 | [diff] [blame] | 253 | |
| 254 | aura::Window* lock_container = |
| 255 | Shell::GetContainer(controller->root_window(), |
| 256 | internal::kShellWindowId_LockScreenContainer); |
| 257 | views::Widget* lock_modal_widget = |
| 258 | CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container); |
| 259 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 260 | internal::kShellWindowId_LockSystemModalContainer)->layout_manager(), |
| 261 | controller->GetSystemModalLayoutManager( |
| 262 | lock_modal_widget->GetNativeView())); |
| 263 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 264 | internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 265 | controller->GetSystemModalLayoutManager( |
| 266 | session_modal_widget->GetNativeView())); |
| 267 | |
[email protected] | 8674b31 | 2012-10-12 19:02:44 | [diff] [blame] | 268 | shell->delegate()->UnlockScreen(); |
| 269 | } |
| 270 | |
[email protected] | 1b21992 | 2012-11-13 21:16:43 | [diff] [blame^] | 271 | TEST_F(RootWindowControllerTest, ModalContainerNotLoggedInLoggedIn) { |
| 272 | UpdateDisplay("600x600"); |
| 273 | Shell* shell = Shell::GetInstance(); |
| 274 | |
| 275 | // Configure login screen environment. |
| 276 | SetUserLoggedIn(false); |
| 277 | EXPECT_EQ(user::LOGGED_IN_NONE, |
| 278 | shell->tray_delegate()->GetUserLoginStatus()); |
| 279 | EXPECT_FALSE(shell->delegate()->IsUserLoggedIn()); |
| 280 | EXPECT_FALSE(shell->delegate()->IsSessionStarted()); |
| 281 | |
| 282 | internal::RootWindowController* controller = |
| 283 | shell->GetPrimaryRootWindowController(); |
| 284 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 285 | internal::kShellWindowId_LockSystemModalContainer)->layout_manager(), |
| 286 | controller->GetSystemModalLayoutManager(NULL)); |
| 287 | |
| 288 | aura::Window* lock_container = |
| 289 | Shell::GetContainer(controller->root_window(), |
| 290 | internal::kShellWindowId_LockScreenContainer); |
| 291 | views::Widget* login_modal_widget = |
| 292 | CreateModalWidgetWithParent(gfx::Rect(300, 10, 100, 100), lock_container); |
| 293 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 294 | internal::kShellWindowId_LockSystemModalContainer)->layout_manager(), |
| 295 | controller->GetSystemModalLayoutManager( |
| 296 | login_modal_widget->GetNativeView())); |
| 297 | login_modal_widget->Close(); |
| 298 | |
| 299 | // Configure user session environment. |
| 300 | SetUserLoggedIn(true); |
| 301 | SetSessionStarted(true); |
| 302 | EXPECT_EQ(user::LOGGED_IN_USER, |
| 303 | shell->tray_delegate()->GetUserLoginStatus()); |
| 304 | EXPECT_TRUE(shell->delegate()->IsUserLoggedIn()); |
| 305 | EXPECT_TRUE(shell->delegate()->IsSessionStarted()); |
| 306 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 307 | internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 308 | controller->GetSystemModalLayoutManager(NULL)); |
| 309 | |
| 310 | views::Widget* session_modal_widget = |
| 311 | CreateModalWidget(gfx::Rect(300, 10, 100, 100)); |
| 312 | EXPECT_EQ(Shell::GetContainer(controller->root_window(), |
| 313 | internal::kShellWindowId_SystemModalContainer)->layout_manager(), |
| 314 | controller->GetSystemModalLayoutManager( |
| 315 | session_modal_widget->GetNativeView())); |
| 316 | } |
| 317 | |
[email protected] | f185312 | 2012-06-27 16:21:26 | [diff] [blame] | 318 | } // namespace test |
| 319 | } // namespace ash |