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

Unified Diff: ash/display/display_controller_unittest.cc

Issue 11419271: Revert "Use WS_POPUP for ash_unittests" (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
« no previous file with comments | « ash/dip_unittest.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index cdf4f7493f89cf0ebf5fe5ee23412596e92a377a..56de605ca6460aa33f4e6775b048cb79402ec623 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -98,11 +98,30 @@ class DisplayControllerShutdownTest : public test::AshTestBase {
typedef test::AshTestBase DisplayControllerTest;
-TEST_F(DisplayControllerShutdownTest, Shutdown) {
+#if defined(OS_WIN)
+// TODO(oshima): Windows creates a window with smaller client area.
+// Fix this and enable tests.
+#define MAYBE_SecondaryDisplayLayout DISABLED_SecondaryDisplayLayout
+#define MAYBE_BoundsUpdated DISABLED_BoundsUpdated
+#define MAYBE_UpdateDisplayWithHostOrigin DISABLED_UpdateDisplayWithHostOrigin
+#define MAYBE_CursorDeviceScaleFactorSwapPrimary \
+ DISABLED_CursorDeviceScaleFactorSwapPrimary
+#define MAYBE_Shutdown DISABLED_Shutdown
+#else
+#define MAYBE_SecondaryDisplayLayout SecondaryDisplayLayout
+#define MAYBE_BoundsUpdated BoundsUpdated
+#define MAYBE_CursorDeviceScaleFactorSwapPrimary \
+ CursorDeviceScaleFactorSwapPrimary
+#define MAYBE_UpdateDisplayWithHostOrigin UpdateDisplayWithHostOrigin
+#define MAYBE_Shutdown Shutdown
+#endif
+
+TEST_F(DisplayControllerShutdownTest, MAYBE_Shutdown) {
UpdateDisplay("444x333, 200x200");
}
-TEST_F(DisplayControllerTest, SecondaryDisplayLayout) {
+// Flaky - crbug.com/161857
+TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) {
TestObserver observer;
UpdateDisplay("500x500,400x400");
EXPECT_EQ(2, observer.CountAndReset())
@@ -207,7 +226,7 @@ TEST_F(DisplayControllerTest, SecondaryDisplayLayout) {
}
-TEST_F(DisplayControllerTest, BoundsUpdated) {
+TEST_F(DisplayControllerTest, MAYBE_BoundsUpdated) {
TestObserver observer;
SetSecondaryDisplayLayout(DisplayLayout::BOTTOM);
UpdateDisplay("200x200,300x300"); // layout, resize and add.
@@ -305,10 +324,12 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
EXPECT_EQ(primary_display.id(),
Shell::GetScreen()->GetDisplayNearestWindow(NULL).id());
+#if !defined(OS_WIN)
EXPECT_EQ("0,0 200x200", primary_display.bounds().ToString());
EXPECT_EQ("0,0 200x152", primary_display.work_area().ToString());
EXPECT_EQ("200,0 300x300", secondary_display.bounds().ToString());
EXPECT_EQ("200,0 300x300", secondary_display.work_area().ToString());
+#endif
// Switch primary and secondary
display_controller->SetPrimaryDisplay(secondary_display);
@@ -330,6 +351,7 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
EXPECT_TRUE(primary_root->Contains(launcher_window));
EXPECT_FALSE(secondary_root->Contains(launcher_window));
+#if !defined(OS_WIN)
// Test if the bounds are correctly swapped.
gfx::Display swapped_primary = Shell::GetScreen()->GetPrimaryDisplay();
gfx::Display swapped_secondary = ScreenAsh::GetSecondaryDisplay();
@@ -337,6 +359,7 @@ TEST_F(DisplayControllerTest, SwapPrimary) {
EXPECT_EQ("0,0 300x252", swapped_primary.work_area().ToString());
EXPECT_EQ("-200,-50 200x200", swapped_secondary.bounds().ToString());
EXPECT_EQ("-200,-50 200x200", swapped_secondary.work_area().ToString());
+#endif
const DisplayLayout& inverted_layout =
display_controller->GetLayoutForDisplay(primary_display);
@@ -479,7 +502,7 @@ TEST_F(DisplayControllerTest, SwapPrimaryById) {
EXPECT_TRUE(primary_root->Contains(launcher_window));
}
-TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
+TEST_F(DisplayControllerTest, MAYBE_CursorDeviceScaleFactorSwapPrimary) {
DisplayController* display_controller =
Shell::GetInstance()->display_controller();
@@ -531,23 +554,16 @@ TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) {
EXPECT_EQ(1.0f, test_api.GetDeviceScaleFactor());
}
-#if defined(OS_WIN)
-// TODO(oshima): On Windows, we don't update the origin/size right away.
-#define MAYBE_UpdateDisplayWithHostOrigin DISABLED_UpdateDisplayWithHostOrigin
-#else
-#define MAYBE_UpdateDisplayWithHostOrigin UpdateDisplayWithHostOrigin
-#endif
-
TEST_F(DisplayControllerTest, MAYBE_UpdateDisplayWithHostOrigin) {
UpdateDisplay("100x200,300x400");
ASSERT_EQ(2, Shell::GetScreen()->GetNumDisplays());
Shell::RootWindowList root_windows =
Shell::GetInstance()->GetAllRootWindows();
ASSERT_EQ(2U, root_windows.size());
- EXPECT_EQ("1,1", root_windows[0]->GetHostOrigin().ToString());
+ EXPECT_EQ("0,0", root_windows[0]->GetHostOrigin().ToString());
EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString());
// UpdateDisplay set the origin if it's not set.
- EXPECT_NE("1,1", root_windows[1]->GetHostOrigin().ToString());
+ EXPECT_NE("0,0", root_windows[1]->GetHostOrigin().ToString());
EXPECT_EQ("300x400", root_windows[1]->GetHostSize().ToString());
UpdateDisplay("100x200,200+300-300x400");
« no previous file with comments | « ash/dip_unittest.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698