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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 1126933004: Allow switching between extended and unified (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index fbb737cfdc97e4833a6fb8d8bc6cc27205bb913a..d9dda9e760a343652cdca99f1d93c633ceecd1a5 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -123,12 +123,8 @@ class DisplayManagerTest : public test::AshTestBase,
// aura::WindowObserver overrides:
void OnWindowDestroying(aura::Window* window) override {
- // TODO(oshima): When moving between unified desktop, the
- // primary root window can be deleted.
- if (!display_manager()->IsInUnifiedMode()) {
- ASSERT_EQ(Shell::GetPrimaryRootWindow(), window);
- root_window_destroyed_ = true;
- }
+ ASSERT_EQ(Shell::GetPrimaryRootWindow(), window);
+ root_window_destroyed_ = true;
}
private:
@@ -1467,11 +1463,15 @@ TEST_F(DisplayManagerTest, MAYBE_UpdateDisplayWithHostOrigin) {
TEST_F(DisplayManagerTest, UnifiedDesktopBasic) {
if (!SupportsMultipleDisplays())
return;
+ // Don't check root window destruction in unified mode.
+ Shell::GetPrimaryRootWindow()->RemoveObserver(this);
- display_manager()->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
- display_manager()->SetMultiDisplayMode(DisplayManager::UNIFIED);
UpdateDisplay("300x200,400x500");
+ // Switch to unified desktop.
+ display_manager()->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
+ display_manager()->ReconfigureDisplays();
+
gfx::Screen* screen =
gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_ALTERNATE);
EXPECT_EQ("700x500", screen->GetPrimaryDisplay().size().ToString());
@@ -1482,18 +1482,26 @@ TEST_F(DisplayManagerTest, UnifiedDesktopBasic) {
display_manager()->SetMirrorMode(false);
EXPECT_EQ("700x500", screen->GetPrimaryDisplay().size().ToString());
- // Swithc to single desktop.
+ // Switch to single desktop.
UpdateDisplay("500x300");
EXPECT_EQ("500x300", screen->GetPrimaryDisplay().size().ToString());
- // Swithc to unified desktop.
+ // Switch to unified desktop.
UpdateDisplay("500x300,400x500");
EXPECT_EQ("900x500", screen->GetPrimaryDisplay().size().ToString());
+
+ // Switch back to extended desktop.
+ display_manager()->SetDefaultMultiDisplayMode(DisplayManager::EXTENDED);
+ display_manager()->ReconfigureDisplays();
+ EXPECT_EQ("500x300", screen->GetPrimaryDisplay().size().ToString());
+ EXPECT_EQ("400x500", ScreenUtil::GetSecondaryDisplay().size().ToString());
}
TEST_F(DisplayManagerTest, RotateUnifiedDesktop) {
if (!SupportsMultipleDisplays())
return;
+ // Don't check root window destruction in unified mode.
+ Shell::GetPrimaryRootWindow()->RemoveObserver(this);
display_manager()->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
display_manager()->SetMultiDisplayMode(DisplayManager::UNIFIED);
@@ -1519,6 +1527,8 @@ TEST_F(DisplayManagerTest, RotateUnifiedDesktop) {
TEST_F(DisplayManagerTest, UnifiedWithDockWindows) {
if (!SupportsMultipleDisplays())
return;
+ // Don't check root window destruction in unified mode.
+ Shell::GetPrimaryRootWindow()->RemoveObserver(this);
display_manager()->SetDefaultMultiDisplayMode(DisplayManager::UNIFIED);
display_manager()->SetMultiDisplayMode(DisplayManager::UNIFIED);
« no previous file with comments | « ash/display/display_manager.cc ('k') | ash/display/mirror_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698