diff options
Diffstat (limited to 'ash/display/display_controller_unittest.cc')
-rw-r--r-- | ash/display/display_controller_unittest.cc | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc index faaa23c..3da1368 100644 --- a/ash/display/display_controller_unittest.cc +++ b/ash/display/display_controller_unittest.cc @@ -790,99 +790,6 @@ TEST_F(DisplayControllerTest, FindNearestDisplay) { gfx::Point(300, 400)).id()); } -TEST_F(DisplayControllerTest, SwapPrimaryForLegacyShelfLayout) { - if (!SupportsMultipleDisplays()) - return; - - CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kAshDisableAlternateShelfLayout); - - DisplayController* display_controller = - Shell::GetInstance()->display_controller(); - DisplayManager* display_manager = Shell::GetInstance()->display_manager(); - - UpdateDisplay("200x200,300x300"); - gfx::Display primary_display = Shell::GetScreen()->GetPrimaryDisplay(); - gfx::Display secondary_display = ScreenUtil::GetSecondaryDisplay(); - - DisplayLayout display_layout(DisplayLayout::RIGHT, 50); - display_manager->SetLayoutForCurrentDisplays(display_layout); - - EXPECT_NE(primary_display.id(), secondary_display.id()); - aura::Window* primary_root = - display_controller->GetRootWindowForDisplayId(primary_display.id()); - aura::Window* secondary_root = - display_controller->GetRootWindowForDisplayId(secondary_display.id()); - EXPECT_NE(primary_root, secondary_root); - aura::Window* shelf_window = - Shelf::ForPrimaryDisplay()->shelf_widget()->GetNativeView(); - EXPECT_TRUE(primary_root->Contains(shelf_window)); - EXPECT_FALSE(secondary_root->Contains(shelf_window)); - EXPECT_EQ(primary_display.id(), - Shell::GetScreen()->GetDisplayNearestPoint( - gfx::Point(-100, -100)).id()); - EXPECT_EQ(primary_display.id(), - Shell::GetScreen()->GetDisplayNearestWindow(NULL).id()); - - EXPECT_EQ("0,0 200x200", primary_display.bounds().ToString()); - EXPECT_EQ("0,0 200x152", primary_display.work_area().ToString()); - EXPECT_EQ("200,0 300x300", secondary_display.bounds().ToString()); - EXPECT_EQ("200,0 300x252", secondary_display.work_area().ToString()); - EXPECT_EQ("right, 50", - display_manager->GetCurrentDisplayLayout().ToString()); - - // Switch primary and secondary - display_controller->SetPrimaryDisplay(secondary_display); - const DisplayLayout& inverted_layout = - display_manager->GetCurrentDisplayLayout(); - EXPECT_EQ("left, -50", inverted_layout.ToString()); - - EXPECT_EQ(secondary_display.id(), - Shell::GetScreen()->GetPrimaryDisplay().id()); - EXPECT_EQ(primary_display.id(), ScreenUtil::GetSecondaryDisplay().id()); - EXPECT_EQ(primary_display.id(), - Shell::GetScreen()->GetDisplayNearestPoint( - gfx::Point(-100, -100)).id()); - EXPECT_EQ(secondary_display.id(), - Shell::GetScreen()->GetDisplayNearestWindow(NULL).id()); - - EXPECT_EQ( - primary_root, - display_controller->GetRootWindowForDisplayId(secondary_display.id())); - EXPECT_EQ( - secondary_root, - display_controller->GetRootWindowForDisplayId(primary_display.id())); - EXPECT_TRUE(primary_root->Contains(shelf_window)); - EXPECT_FALSE(secondary_root->Contains(shelf_window)); - - // Test if the bounds are correctly swapped. - gfx::Display swapped_primary = Shell::GetScreen()->GetPrimaryDisplay(); - gfx::Display swapped_secondary = ScreenUtil::GetSecondaryDisplay(); - EXPECT_EQ("0,0 300x300", swapped_primary.bounds().ToString()); - EXPECT_EQ("0,0 300x252", swapped_primary.work_area().ToString()); - EXPECT_EQ("-200,-50 200x200", swapped_secondary.bounds().ToString()); - - EXPECT_EQ("-200,-50 200x152", swapped_secondary.work_area().ToString()); - - aura::WindowTracker tracker; - tracker.Add(primary_root); - tracker.Add(secondary_root); - - // Deleting 2nd display should move the primary to original primary display. - UpdateDisplay("200x200"); - RunAllPendingInMessageLoop(); // RootWindow is deleted in a posted task. - EXPECT_EQ(1, Shell::GetScreen()->GetNumDisplays()); - EXPECT_EQ(primary_display.id(), Shell::GetScreen()->GetPrimaryDisplay().id()); - EXPECT_EQ(primary_display.id(), - Shell::GetScreen()->GetDisplayNearestPoint( - gfx::Point(-100, -100)).id()); - EXPECT_EQ(primary_display.id(), - Shell::GetScreen()->GetDisplayNearestWindow(NULL).id()); - EXPECT_TRUE(tracker.Contains(primary_root)); - EXPECT_FALSE(tracker.Contains(secondary_root)); - EXPECT_TRUE(primary_root->Contains(shelf_window)); -} - TEST_F(DisplayControllerTest, SwapPrimaryById) { if (!SupportsMultipleDisplays()) return; |