Chromium Code Reviews| Index: ash/root_window_controller_unittest.cc |
| diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc |
| index f331afb6912f52524f599ab8aeee6b3383cab0b3..be5911cc69779d1d0dce032fa3ed9c6df761f1ce 100644 |
| --- a/ash/root_window_controller_unittest.cc |
| +++ b/ash/root_window_controller_unittest.cc |
| @@ -458,6 +458,40 @@ TEST_F(RootWindowControllerTest, GetWindowForFullscreenMode) { |
| EXPECT_EQ(NULL, controller->GetWindowForFullscreenMode()); |
| } |
| +TEST_F(RootWindowControllerTest, MultipleDisplaysGetWindowForFullscreenMode) { |
| + if (!SupportsMultipleDisplays()) |
| + return; |
| + |
| + UpdateDisplay("600x600,600x600"); |
| + Shell::RootWindowControllerList controllers = |
| + Shell::GetInstance()->GetAllRootWindowControllers(); |
| + |
| + Widget* w1 = CreateTestWidget(gfx::Rect(0, 0, 100, 100)); |
| + w1->Maximize(); |
| + Widget* w2 = CreateTestWidget(gfx::Rect(0, 0, 100, 100)); |
| + w2->SetFullscreen(true); |
| + Widget* w3 = CreateTestWidget(gfx::Rect(600, 0, 100, 100)); |
| + |
| + EXPECT_EQ(w1->GetNativeWindow()->GetRootWindow(), |
| + controllers[0]->root_window()); |
| + EXPECT_EQ(w2->GetNativeWindow()->GetRootWindow(), |
| + controllers[0]->root_window()); |
| + EXPECT_EQ(w3->GetNativeWindow()->GetRootWindow(), |
| + controllers[1]->root_window()); |
| + |
| + w2->Activate(); |
| + EXPECT_EQ(w2->GetNativeWindow(), |
| + controllers[0]->GetWindowForFullscreenMode()); |
| + EXPECT_EQ(NULL, controllers[1]->GetWindowForFullscreenMode()); |
| + |
| + // Verify that the first root window controller remains in fullscreen mode |
| + // when a window on the other display is activated. |
| + w3->Activate(); |
| + EXPECT_EQ(w2->GetNativeWindow(), |
| + controllers[0]->GetWindowForFullscreenMode()); |
|
oshima
2014/02/10 19:21:06
indent
flackr
2014/02/10 21:45:28
Done.
|
| + EXPECT_EQ(NULL, controllers[1]->GetWindowForFullscreenMode()); |
|
oshima
2014/02/10 19:21:06
can you also add scenario where w1 is activated?
flackr
2014/02/10 21:45:28
Done.
|
| +} |
| + |
| // Test that user session window can't be focused if user session blocked by |
| // some overlapping UI. |
| TEST_F(RootWindowControllerTest, FocusBlockedWindow) { |