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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 15367003: Create a mirror window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 7 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
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 0706b0ee1313594739bcad47fb1d2b1a329b00f4..01065762680b14351011ae7cd585f17b1e573809 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -9,6 +9,7 @@
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
+#include "ash/test/mirror_window_test_api.h"
#include "base/format_macros.h"
#include "base/stringprintf.h"
#include "ui/aura/env.h"
@@ -712,7 +713,11 @@ TEST_F(DisplayManagerTest, Rotate) {
GetDisplayInfoAt(1).bounds_in_pixel().ToString());
EXPECT_EQ("400x300",
GetDisplayInfoAt(1).size_in_pixel().ToString());
+ reset();
UpdateDisplay("100x200/b,300x400");
+ EXPECT_EQ("2 0 0", GetCountSummary());
+ reset();
+
EXPECT_EQ("1,1 100x200",
GetDisplayInfoAt(0).bounds_in_pixel().ToString());
EXPECT_EQ("100x200",
@@ -722,6 +727,13 @@ TEST_F(DisplayManagerTest, Rotate) {
GetDisplayInfoAt(1).bounds_in_pixel().ToString());
EXPECT_EQ("300x400",
GetDisplayInfoAt(1).size_in_pixel().ToString());
+
+ UpdateDisplay("200x200");
+ EXPECT_EQ("1 0 1", GetCountSummary());
+ reset();
+
+ UpdateDisplay("200x200/l");
+ EXPECT_EQ("1 0 0", GetCountSummary());
}
TEST_F(DisplayManagerTest, UIScale) {
@@ -839,5 +851,26 @@ TEST_F(DisplayManagerTest, MAYBE_UpdateMouseCursorAfterRotateZoom) {
EXPECT_EQ("750,75", env->last_mouse_location().ToString());
}
+TEST_F(DisplayManagerTest, SoftwareMirroring) {
James Cook 2013/05/21 08:07:41 Hooray, new code has a new test!
+ UpdateDisplay("300x400,400x500");
+
+ test::MirrorWindowTestApi test_api;
+ EXPECT_EQ(NULL, test_api.GetRootWindow());
+
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ display_manager->SetSoftwareMirroring(true);
+ display_manager->UpdateDisplays();
+ EXPECT_EQ(1U, display_manager->GetNumDisplays());
+ EXPECT_EQ("0,0 300x400",
+ Shell::GetScreen()->GetPrimaryDisplay().bounds().ToString());
+ EXPECT_EQ("400x500", test_api.GetRootWindow()->GetHostSize().ToString());
+ EXPECT_TRUE(display_manager->IsMirrored());
+
+ display_manager->SetMirrorMode(false);
+ EXPECT_EQ(NULL, test_api.GetRootWindow());
+ EXPECT_EQ(2U, display_manager->GetNumDisplays());
+ EXPECT_FALSE(display_manager->IsMirrored());
+}
+
} // namespace internal
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698