Index: ash/display/display_controller_unittest.cc |
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc |
index 56de605ca6460aa33f4e6775b048cb79402ec623..cdf4f7493f89cf0ebf5fe5ee23412596e92a377a 100644 |
--- a/ash/display/display_controller_unittest.cc |
+++ b/ash/display/display_controller_unittest.cc |
@@ -98,30 +98,11 @@ class DisplayControllerShutdownTest : public test::AshTestBase { |
typedef test::AshTestBase DisplayControllerTest; |
-#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) { |
+TEST_F(DisplayControllerShutdownTest, Shutdown) { |
UpdateDisplay("444x333, 200x200"); |
} |
-// Flaky - crbug.com/161857 |
-TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) { |
+TEST_F(DisplayControllerTest, SecondaryDisplayLayout) { |
TestObserver observer; |
UpdateDisplay("500x500,400x400"); |
EXPECT_EQ(2, observer.CountAndReset()) |
@@ -226,7 +207,7 @@ TEST_F(DisplayControllerTest, MAYBE_SecondaryDisplayLayout) { |
} |
-TEST_F(DisplayControllerTest, MAYBE_BoundsUpdated) { |
+TEST_F(DisplayControllerTest, BoundsUpdated) { |
TestObserver observer; |
SetSecondaryDisplayLayout(DisplayLayout::BOTTOM); |
UpdateDisplay("200x200,300x300"); // layout, resize and add. |
@@ -324,12 +305,10 @@ 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); |
@@ -351,7 +330,6 @@ 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(); |
@@ -359,7 +337,6 @@ 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); |
@@ -502,7 +479,7 @@ TEST_F(DisplayControllerTest, SwapPrimaryById) { |
EXPECT_TRUE(primary_root->Contains(launcher_window)); |
} |
-TEST_F(DisplayControllerTest, MAYBE_CursorDeviceScaleFactorSwapPrimary) { |
+TEST_F(DisplayControllerTest, CursorDeviceScaleFactorSwapPrimary) { |
DisplayController* display_controller = |
Shell::GetInstance()->display_controller(); |
@@ -554,16 +531,23 @@ TEST_F(DisplayControllerTest, MAYBE_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("0,0", root_windows[0]->GetHostOrigin().ToString()); |
+ EXPECT_EQ("1,1", root_windows[0]->GetHostOrigin().ToString()); |
EXPECT_EQ("100x200", root_windows[0]->GetHostSize().ToString()); |
// UpdateDisplay set the origin if it's not set. |
- EXPECT_NE("0,0", root_windows[1]->GetHostOrigin().ToString()); |
+ EXPECT_NE("1,1", root_windows[1]->GetHostOrigin().ToString()); |
EXPECT_EQ("300x400", root_windows[1]->GetHostSize().ToString()); |
UpdateDisplay("100x200,200+300-300x400"); |