Chromium Code Reviews| Index: ash/wm/panels/panel_window_resizer_unittest.cc |
| diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc |
| index 5939e6ce6286b6c65a0c2f51056d147b891e53eb..500f158b853f78a344411a666406368a55c5fc34 100644 |
| --- a/ash/wm/panels/panel_window_resizer_unittest.cc |
| +++ b/ash/wm/panels/panel_window_resizer_unittest.cc |
| @@ -59,6 +59,13 @@ class PanelWindowResizerTest : public test::AshTestBase { |
| return location; |
| } |
| + aura::Window* CreateWindow(const gfx::Point& origin) { |
| + gfx::Rect bounds(origin, gfx::Size(101, 101)); |
| + aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
| + NULL, ui::wm::WINDOW_TYPE_NORMAL, 0, bounds); |
| + return window; |
| + } |
|
oshima
2014/02/21 19:49:46
Looks a bit overkill. Can you just do
CreateTestW
flackr
2014/02/24 16:21:10
Done.
|
| + |
| aura::Window* CreatePanelWindow(const gfx::Point& origin) { |
| gfx::Rect bounds(origin, gfx::Size(101, 101)); |
| aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
| @@ -400,6 +407,41 @@ TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) { |
| EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id()); |
| } |
| +TEST_F(PanelWindowResizerTest, AttachToSecondFullscreenDisplay) { |
| + if (!SupportsMultipleDisplays()) |
| + return; |
| + |
| + UpdateDisplay("600x400,600x600"); |
| + aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| + scoped_ptr<aura::Window> window( |
| + CreatePanelWindow(gfx::Point(0, 0))); |
| + scoped_ptr<aura::Window> fullscreen( |
| + CreateWindow(gfx::Point(600, 0))); |
| + wm::GetWindowState(fullscreen.get())->Activate(); |
| + wm::GetWindowState(fullscreen.get())->ToggleFullscreen(); |
| + EXPECT_TRUE(wm::GetWindowState(fullscreen.get())->IsFullscreen()); |
| + |
| + gfx::Rect initial_bounds = window->GetBoundsInScreen(); |
| + EXPECT_EQ(root_windows[0], window->GetRootWindow()); |
| + |
| + // Activate and drag the window to the other display's launcher. |
| + wm::GetWindowState(window.get())->Activate(); |
| + DragStart(window.get()); |
| + DragMove(500, 250); |
| + EXPECT_EQ(initial_bounds.x() + 500, window->GetBoundsInScreen().x()); |
| + EXPECT_GT(window->GetBoundsInScreen().y(), |
| + initial_bounds.y() + 200); |
| + DragEnd(); |
| + |
| + // When dropped should move to second display's panel container. |
| + EXPECT_EQ(root_windows[1], window->GetRootWindow()); |
| + EXPECT_TRUE(wm::GetWindowState(window.get())->panel_attached()); |
| + EXPECT_EQ(internal::kShellWindowId_PanelContainer, window->parent()->id()); |
| + EXPECT_TRUE(window->IsVisible()); |
| + EXPECT_TRUE(wm::GetWindowState(window.get())->IsActive()); |
| + EXPECT_EQ(initial_bounds.y() + 200, window->GetBoundsInScreen().y()); |
| +} |
| + |
| TEST_F(PanelWindowResizerTest, RevertDragRestoresAttachment) { |
| scoped_ptr<aura::Window> window( |
| CreatePanelWindow(gfx::Point(0, 0))); |