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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 11644012: Temporarily remember the primary root window while replacing the display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« ash/display/display_controller.h ('K') | « ash/display/display_controller.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 ddd20cfa0fd7f884667269c738d991ba329df69d..b43944b7b16fcd3a3e6dd23302c8733f6d413144 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -392,6 +392,23 @@ TEST_F(DisplayManagerTest, TestNativeDisplaysChanged) {
EXPECT_EQ(2U, display_manager()->GetNumDisplays());
}
+TEST_F(DisplayManagerTest, TestNativeDisplaysChangedNoInternal) {
+ EXPECT_EQ(1U, display_manager()->GetNumDisplays());
+
+ // Don't change the display info if all displays are disconnected.
+ std::vector<gfx::Display> displays;
+ display_manager()->OnNativeDisplaysChanged(displays);
+ EXPECT_EQ(1U, display_manager()->GetNumDisplays());
+
+ // Connect another display which will become primary.
+ const gfx::Display external_display(10, gfx::Rect(1, 1, 100, 100));
+ displays.push_back(external_display);
+ display_manager()->OnNativeDisplaysChanged(displays);
+ EXPECT_EQ(1U, display_manager()->GetNumDisplays());
+ EXPECT_EQ("1,1 100x100",
+ FindDisplayForId(10).bounds_in_pixel().ToString());
+}
+
TEST_F(DisplayManagerTest, EnsurePointerInDisplays) {
UpdateDisplay("200x200,300x300");
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
« ash/display/display_controller.h ('K') | « ash/display/display_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698