Index: ash/display/display_manager_unittest.cc |
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc |
index e3e7f8c9c16c1c850f760f4b301c584ac578ecd0..e7f71c4f8c5525a957d4ca02eaa28246131ce7be 100644 |
--- a/ash/display/display_manager_unittest.cc |
+++ b/ash/display/display_manager_unittest.cc |
@@ -9,6 +9,7 @@ |
#include "ash/display/display_info.h" |
#include "ash/display/display_layout_store.h" |
#include "ash/display/display_util.h" |
+#include "ash/display/mirror_window_controller.h" |
#include "ash/screen_util.h" |
#include "ash/shell.h" |
#include "ash/test/ash_test_base.h" |
@@ -1342,6 +1343,27 @@ TEST_F(DisplayManagerTest, SoftwareMirroring) { |
Shell::GetScreen()->RemoveObserver(&display_observer); |
} |
+TEST_F(DisplayManagerTest, SingleDisplayToSoftwareMirroring) { |
+ if (!SupportsMultipleDisplays()) |
+ return; |
+ UpdateDisplay("600x400"); |
+ |
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
+ display_manager->SetSecondDisplayMode(DisplayManager::MIRRORING); |
+ UpdateDisplay("600x400,600x400"); |
+ |
+ EXPECT_TRUE(display_manager->IsMirrored()); |
+ EXPECT_EQ(1U, display_manager->GetNumDisplays()); |
+ DisplayController* display_controller = |
+ ash::Shell::GetInstance()->display_controller(); |
+ EXPECT_TRUE(display_controller->mirror_window_controller()->GetWindow()); |
+ |
+ UpdateDisplay("600x400"); |
+ EXPECT_FALSE(display_manager->IsMirrored()); |
+ EXPECT_EQ(1U, display_manager->GetNumDisplays()); |
+ EXPECT_FALSE(display_controller->mirror_window_controller()->GetWindow()); |
+} |
+ |
#if defined(OS_CHROMEOS) |
// Make sure this does not cause any crashes. See http://crbug.com/412910 |
// This test is limited to OS_CHROMEOS because CursorCompositingEnabled is only |