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

Side by Side Diff: ash/display/display_manager_unittest.cc

Issue 2700523004: Remove docked windows entirely in M59. (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « ash/common/wm/workspace_controller.cc ('k') | ash/metrics/user_metrics_recorder.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 (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 "ui/display/manager/display_manager.h" 5 #include "ui/display/manager/display_manager.h"
6 6
7 #include "ash/accelerators/accelerator_commands_aura.h" 7 #include "ash/accelerators/accelerator_commands_aura.h"
8 #include "ash/common/ash_switches.h" 8 #include "ash/common/ash_switches.h"
9 #include "ash/common/wm/window_state.h" 9 #include "ash/common/wm/window_state.h"
10 #include "ash/display/display_configuration_controller.h" 10 #include "ash/display/display_configuration_controller.h"
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 EXPECT_EQ("1150x500", screen->GetPrimaryDisplay().size().ToString()); 2663 EXPECT_EQ("1150x500", screen->GetPrimaryDisplay().size().ToString());
2664 display_manager()->SetDisplayRotation( 2664 display_manager()->SetDisplayRotation(
2665 display.id(), display::Display::ROTATE_0, 2665 display.id(), display::Display::ROTATE_0,
2666 display::Display::ROTATION_SOURCE_ACTIVE); 2666 display::Display::ROTATION_SOURCE_ACTIVE);
2667 EXPECT_EQ("1150x500", screen->GetPrimaryDisplay().size().ToString()); 2667 EXPECT_EQ("1150x500", screen->GetPrimaryDisplay().size().ToString());
2668 2668
2669 UpdateDisplay("400x500"); 2669 UpdateDisplay("400x500");
2670 EXPECT_EQ("400x500", screen->GetPrimaryDisplay().size().ToString()); 2670 EXPECT_EQ("400x500", screen->GetPrimaryDisplay().size().ToString());
2671 } 2671 }
2672 2672
2673 // Makes sure the transition from unified to single won't crash
2674 // with docked windows.
2675 TEST_F(DisplayManagerTest, UnifiedWithDockWindows) {
2676 // Enable window docking for this test.
2677 base::CommandLine::ForCurrentProcess()->AppendSwitch(
2678 ash::switches::kAshEnableDockedWindows);
2679
2680 display_manager()->SetUnifiedDesktopEnabled(true);
2681
2682 // Don't check root window destruction in unified mode.
2683 Shell::GetPrimaryRootWindow()->RemoveObserver(this);
2684
2685 UpdateDisplay("400x500,300x200");
2686
2687 std::unique_ptr<aura::Window> docked(
2688 CreateTestWindowInShellWithBounds(gfx::Rect(10, 10, 50, 50)));
2689 docked->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_DOCKED);
2690 ASSERT_TRUE(wm::GetWindowState(docked.get())->IsDocked());
2691 // 48 pixels reserved for launcher shelf height.
2692 EXPECT_EQ(gfx::Rect(0, 0, 250, 452).ToString(), docked->bounds().ToString());
2693 UpdateDisplay("300x300");
2694 // Make sure the window is still docked.
2695 EXPECT_TRUE(wm::GetWindowState(docked.get())->IsDocked());
2696 EXPECT_EQ(gfx::Rect(0, 0, 250, 252).ToString(), docked->bounds().ToString());
2697 }
2698
2699 TEST_F(DisplayManagerTest, DockMode) { 2673 TEST_F(DisplayManagerTest, DockMode) {
2700 const int64_t internal_id = 1; 2674 const int64_t internal_id = 1;
2701 const int64_t external_id = 2; 2675 const int64_t external_id = 2;
2702 2676
2703 const display::ManagedDisplayInfo internal_display_info = 2677 const display::ManagedDisplayInfo internal_display_info =
2704 CreateDisplayInfo(internal_id, gfx::Rect(0, 0, 500, 500)); 2678 CreateDisplayInfo(internal_id, gfx::Rect(0, 0, 500, 500));
2705 const display::ManagedDisplayInfo external_display_info = 2679 const display::ManagedDisplayInfo external_display_info =
2706 CreateDisplayInfo(external_id, gfx::Rect(1, 1, 100, 100)); 2680 CreateDisplayInfo(external_id, gfx::Rect(1, 1, 100, 100));
2707 std::vector<display::ManagedDisplayInfo> display_info_list; 2681 std::vector<display::ManagedDisplayInfo> display_info_list;
2708 2682
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2947 display::DisplayIdList list = display::test::CreateDisplayIdList2(id1, id2); 2921 display::DisplayIdList list = display::test::CreateDisplayIdList2(id1, id2);
2948 layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout)); 2922 layout_store->RegisterLayoutForDisplayIdList(list, std::move(old_layout));
2949 const display::DisplayLayout& stored = 2923 const display::DisplayLayout& stored =
2950 layout_store->GetRegisteredDisplayLayout(list); 2924 layout_store->GetRegisteredDisplayLayout(list);
2951 2925
2952 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id); 2926 EXPECT_EQ(id1, stored.placement_list[0].parent_display_id);
2953 EXPECT_EQ(id2, stored.placement_list[0].display_id); 2927 EXPECT_EQ(id2, stored.placement_list[0].display_id);
2954 } 2928 }
2955 2929
2956 } // namespace ash 2930 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/workspace_controller.cc ('k') | ash/metrics/user_metrics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698