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

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

Issue 1119953002: Enable display rotation, magnifier 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"
26 #include "ash/test/shelf_test_api.h" 25 #include "ash/test/shelf_test_api.h"
27 #include "ash/wm/window_state.h" 26 #include "ash/wm/window_state.h"
28 #include "ash/wm/window_util.h" 27 #include "ash/wm/window_util.h"
29 #include "base/command_line.h" 28 #include "base/command_line.h"
30 #include "base/strings/utf_string_conversions.h" 29 #include "base/strings/utf_string_conversions.h"
31 #include "ui/aura/client/aura_constants.h" 30 #include "ui/aura/client/aura_constants.h"
32 #include "ui/aura/client/window_tree_client.h" 31 #include "ui/aura/client/window_tree_client.h"
33 #include "ui/aura/window.h" 32 #include "ui/aura/window.h"
34 #include "ui/aura/window_event_dispatcher.h" 33 #include "ui/aura/window_event_dispatcher.h"
35 #include "ui/compositor/layer.h" 34 #include "ui/compositor/layer.h"
(...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 // would normally cause the ShelfLayoutManager to update its state. However 2270 // would normally cause the ShelfLayoutManager to update its state. However
2272 // during shutdown we want to handle this without crashing. 2271 // during shutdown we want to handle this without crashing.
2273 delete window1; 2272 delete window1;
2274 } 2273 }
2275 2274
2276 TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) { 2275 TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) {
2277 if (!SupportsMultipleDisplays()) 2276 if (!SupportsMultipleDisplays())
2278 return; 2277 return;
2279 2278
2280 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 2279 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
2281 test::DisplayManagerTestApi test_api(display_manager); 2280 display_manager->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
2282 test_api.SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
2283 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED); 2281 display_manager->SetMultiDisplayMode(DisplayManager::UNIFIED);
2284 UpdateDisplay("500x500, 500x500"); 2282 UpdateDisplay("500x500, 500x500");
2285 2283
2286 StatusAreaWidget* status_area_widget = 2284 StatusAreaWidget* status_area_widget =
2287 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget(); 2285 Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget();
2288 EXPECT_TRUE(status_area_widget->IsVisible()); 2286 EXPECT_TRUE(status_area_widget->IsVisible());
2289 // Shelf should be in the first display's area. 2287 // Shelf should be in the first display's area.
2290 EXPECT_EQ("348,453 152x47", 2288 EXPECT_EQ("348,453 152x47",
2291 status_area_widget->GetWindowBoundsInScreen().ToString()); 2289 status_area_widget->GetWindowBoundsInScreen().ToString());
2292 } 2290 }
2293 2291
2294 } // namespace ash 2292 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698