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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 1019093002: Update mirroring display even if the display configurations that are visible to ash/chrome hasn't c… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_manager.cc ('k') | no next file » | 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 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
« no previous file with comments | « ash/display/display_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698