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

Side by Side Diff: ash/wm/dock/docked_window_layout_manager_unittest.cc

Issue 597683003: Add window states docked; and docked minimized. Add wm window event to set docked and undocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dock
Patch Set: Pull forward a change from the dependant CL to this Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/dock/docked_window_resizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/dock/docked_window_layout_manager.h" 5 #include "ash/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_layout_manager.h" 10 #include "ash/shelf/shelf_layout_manager.h"
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 // The last two windows should be attached and snapped to the right edge. 703 // The last two windows should be attached and snapped to the right edge.
704 EXPECT_EQ(w2->GetRootWindow()->bounds().right(), 704 EXPECT_EQ(w2->GetRootWindow()->bounds().right(),
705 w2->GetBoundsInScreen().right()); 705 w2->GetBoundsInScreen().right());
706 EXPECT_EQ(kShellWindowId_DockedContainer, w2->parent()->id()); 706 EXPECT_EQ(kShellWindowId_DockedContainer, w2->parent()->id());
707 EXPECT_EQ(w3->GetRootWindow()->bounds().right(), 707 EXPECT_EQ(w3->GetRootWindow()->bounds().right(),
708 w3->GetBoundsInScreen().right()); 708 w3->GetBoundsInScreen().right());
709 EXPECT_EQ(kShellWindowId_DockedContainer, w3->parent()->id()); 709 EXPECT_EQ(kShellWindowId_DockedContainer, w3->parent()->id());
710 710
711 // The first window should get minimized but parented by the dock container. 711 // The first window should get minimized but parented by the dock container.
712 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMinimized()); 712 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMinimized());
713 EXPECT_TRUE(wm::GetWindowState(w2.get())->IsNormalStateType()); 713 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsDocked());
714 EXPECT_TRUE(wm::GetWindowState(w3.get())->IsNormalStateType()); 714 EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMinimized());
715 EXPECT_TRUE(wm::GetWindowState(w2.get())->IsDocked());
716 EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMinimized());
717 EXPECT_TRUE(wm::GetWindowState(w3.get())->IsDocked());
715 EXPECT_EQ(kShellWindowId_DockedContainer, w1->parent()->id()); 718 EXPECT_EQ(kShellWindowId_DockedContainer, w1->parent()->id());
716 } 719 }
717 720
718 // Docks up to three windows and tests that they split vertical space. 721 // Docks up to three windows and tests that they split vertical space.
719 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsSplitHeightEvenly) { 722 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsSplitHeightEvenly) {
720 if (!SupportsHostWindowResize()) 723 if (!SupportsHostWindowResize())
721 return; 724 return;
722 725
723 UpdateDisplay("600x1000"); 726 UpdateDisplay("600x1000");
724 scoped_ptr<aura::Window> w1(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); 727 scoped_ptr<aura::Window> w1(CreateTestWindow(gfx::Rect(0, 0, 201, 201)));
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height()); 834 EXPECT_EQ(work_area.height(), window->GetBoundsInScreen().height());
832 } 835 }
833 836
834 // Tests run twice - on both panels and normal windows 837 // Tests run twice - on both panels and normal windows
835 INSTANTIATE_TEST_CASE_P(NormalOrPanel, 838 INSTANTIATE_TEST_CASE_P(NormalOrPanel,
836 DockedWindowLayoutManagerTest, 839 DockedWindowLayoutManagerTest,
837 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, 840 testing::Values(ui::wm::WINDOW_TYPE_NORMAL,
838 ui::wm::WINDOW_TYPE_PANEL)); 841 ui::wm::WINDOW_TYPE_PANEL));
839 842
840 } // namespace ash 843 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/dock/docked_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698