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

Side by Side Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 1116313002: Layout login/lock screen, shelf and app list inside the first display in Unified Desktop mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_controller.h" 10 #include "ash/display/display_controller.h"
11 #include "ash/display/display_manager.h" 11 #include "ash/display/display_manager.h"
12 #include "ash/focus_cycler.h" 12 #include "ash/focus_cycler.h"
13 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
14 #include "ash/session/session_state_delegate.h" 14 #include "ash/session/session_state_delegate.h"
15 #include "ash/shelf/shelf.h" 15 #include "ash/shelf/shelf.h"
16 #include "ash/shelf/shelf_layout_manager_observer.h" 16 #include "ash/shelf/shelf_layout_manager_observer.h"
17 #include "ash/shelf/shelf_view.h" 17 #include "ash/shelf/shelf_view.h"
18 #include "ash/shelf/shelf_widget.h" 18 #include "ash/shelf/shelf_widget.h"
19 #include "ash/shell.h" 19 #include "ash/shell.h"
20 #include "ash/shell_window_ids.h" 20 #include "ash/shell_window_ids.h"
21 #include "ash/system/status_area_widget.h" 21 #include "ash/system/status_area_widget.h"
22 #include "ash/system/tray/system_tray.h" 22 #include "ash/system/tray/system_tray.h"
23 #include "ash/system/tray/system_tray_item.h" 23 #include "ash/system/tray/system_tray_item.h"
24 #include "ash/test/ash_test_base.h" 24 #include "ash/test/ash_test_base.h"
25 #include "ash/test/display_manager_test_api.h"
25 #include "ash/test/shelf_test_api.h" 26 #include "ash/test/shelf_test_api.h"
26 #include "ash/wm/window_state.h" 27 #include "ash/wm/window_state.h"
27 #include "ash/wm/window_util.h" 28 #include "ash/wm/window_util.h"
28 #include "base/command_line.h" 29 #include "base/command_line.h"
29 #include "base/strings/utf_string_conversions.h" 30 #include "base/strings/utf_string_conversions.h"
30 #include "ui/aura/client/aura_constants.h" 31 #include "ui/aura/client/aura_constants.h"
31 #include "ui/aura/client/window_tree_client.h" 32 #include "ui/aura/client/window_tree_client.h"
32 #include "ui/aura/window.h" 33 #include "ui/aura/window.h"
33 #include "ui/aura/window_event_dispatcher.h" 34 #include "ui/aura/window_event_dispatcher.h"
34 #include "ui/compositor/layer.h" 35 #include "ui/compositor/layer.h"
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 2263
2263 shelf->ShutdownStatusAreaWidget(); 2264 shelf->ShutdownStatusAreaWidget();
2264 shelf_manager->PrepareForShutdown(); 2265 shelf_manager->PrepareForShutdown();
2265 2266
2266 // Deleting a focused maximized window will switch focus to |window2|. This 2267 // Deleting a focused maximized window will switch focus to |window2|. This
2267 // would normally cause the ShelfLayoutManager to update its state. However 2268 // would normally cause the ShelfLayoutManager to update its state. However
2268 // during shutdown we want to handle this without crashing. 2269 // during shutdown we want to handle this without crashing.
2269 delete window1; 2270 delete window1;
2270 } 2271 }
2271 2272
2273 TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) {
2274 if (!SupportsMultipleDisplays())
2275 return;
2276
2277 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
2278 test::DisplayManagerTestApi test_api(display_manager);
2279 test_api.SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
2280 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED);
2281 UpdateDisplay("500x500, 500x500");
2282
2283 StatusAreaWidget* status_area_widget =
2284 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget();
2285 EXPECT_TRUE(status_area_widget->IsVisible());
2286 // Shelf should be in the first display's area.
2287 EXPECT_EQ("348,453 152x47",
2288 status_area_widget->GetWindowBoundsInScreen().ToString());
2289 }
2290
2272 } // namespace ash 2291 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698