OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h" | 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h" |
6 | 6 |
7 #include "ash/wm/window_state.h" | 7 #include "ash/wm/window_state.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2143 // The bounds of the initial window should not have changed. | 2143 // The bounds of the initial window should not have changed. |
2144 EXPECT_TRUE(browser()->window()->IsMaximized()); | 2144 EXPECT_TRUE(browser()->window()->IsMaximized()); |
2145 | 2145 |
2146 EXPECT_TRUE(GetTrackedByWorkspace(browser())); | 2146 EXPECT_TRUE(GetTrackedByWorkspace(browser())); |
2147 EXPECT_TRUE(GetTrackedByWorkspace(new_browser)); | 2147 EXPECT_TRUE(GetTrackedByWorkspace(new_browser)); |
2148 // After this both windows should still be manageable. | 2148 // After this both windows should still be manageable. |
2149 EXPECT_TRUE(IsWindowPositionManaged(browser()->window()->GetNativeWindow())); | 2149 EXPECT_TRUE(IsWindowPositionManaged(browser()->window()->GetNativeWindow())); |
2150 EXPECT_TRUE(IsWindowPositionManaged( | 2150 EXPECT_TRUE(IsWindowPositionManaged( |
2151 new_browser->window()->GetNativeWindow())); | 2151 new_browser->window()->GetNativeWindow())); |
2152 | 2152 |
2153 // The new window should be docked and not maximized if docking is allowed. | |
2154 ash::wm::WindowState* window_state = | 2153 ash::wm::WindowState* window_state = |
2155 ash::wm::GetWindowState(new_browser->window()->GetNativeWindow()); | 2154 ash::wm::GetWindowState(new_browser->window()->GetNativeWindow()); |
| 2155 // The new window should not be maximized because it gets docked or snapped. |
| 2156 EXPECT_FALSE(new_browser->window()->IsMaximized()); |
2156 if (docked_windows_enabled()) { | 2157 if (docked_windows_enabled()) { |
2157 EXPECT_FALSE(new_browser->window()->IsMaximized()); | 2158 // The new window should be docked and not snapped if docking is allowed. |
2158 EXPECT_TRUE(window_state->IsDocked()); | 2159 EXPECT_TRUE(window_state->IsDocked()); |
| 2160 EXPECT_FALSE(window_state->IsSnapped()); |
2159 } else { | 2161 } else { |
2160 EXPECT_TRUE(new_browser->window()->IsMaximized()); | 2162 // The new window should be snapped and not docked if docking is disabled. |
2161 EXPECT_FALSE(window_state->IsDocked()); | 2163 EXPECT_FALSE(window_state->IsDocked()); |
| 2164 EXPECT_TRUE(window_state->IsSnapped()); |
2162 } | 2165 } |
2163 } | 2166 } |
2164 | 2167 |
2165 | 2168 |
2166 #endif | 2169 #endif |
2167 | 2170 |
2168 #if defined(USE_ASH) && !defined(OS_WIN) // TODO(win_ash) | 2171 #if defined(USE_ASH) && !defined(OS_WIN) // TODO(win_ash) |
2169 INSTANTIATE_TEST_CASE_P(TabDragging, | 2172 INSTANTIATE_TEST_CASE_P(TabDragging, |
2170 DetachToBrowserInSeparateDisplayTabDragControllerTest, | 2173 DetachToBrowserInSeparateDisplayTabDragControllerTest, |
2171 ::testing::Values("mouse", "touch")); | 2174 ::testing::Values("mouse", "touch")); |
2172 INSTANTIATE_TEST_CASE_P(TabDragging, | 2175 INSTANTIATE_TEST_CASE_P(TabDragging, |
2173 DifferentDeviceScaleFactorDisplayTabDragControllerTest, | 2176 DifferentDeviceScaleFactorDisplayTabDragControllerTest, |
2174 ::testing::Values("mouse")); | 2177 ::testing::Values("mouse")); |
2175 INSTANTIATE_TEST_CASE_P(TabDragging, | 2178 INSTANTIATE_TEST_CASE_P(TabDragging, |
2176 DetachToBrowserTabDragControllerTest, | 2179 DetachToBrowserTabDragControllerTest, |
2177 ::testing::Values("mouse", "touch")); | 2180 ::testing::Values("mouse", "touch")); |
2178 INSTANTIATE_TEST_CASE_P(TabDragging, | 2181 INSTANTIATE_TEST_CASE_P(TabDragging, |
2179 DetachToDockedTabDragControllerTest, | 2182 DetachToDockedTabDragControllerTest, |
2180 ::testing::Values("mouse", "mouse docked")); | 2183 ::testing::Values("mouse", "mouse docked")); |
2181 INSTANTIATE_TEST_CASE_P(TabDragging, | 2184 INSTANTIATE_TEST_CASE_P(TabDragging, |
2182 DetachToBrowserTabDragControllerTestTouch, | 2185 DetachToBrowserTabDragControllerTestTouch, |
2183 ::testing::Values("touch", "touch docked")); | 2186 ::testing::Values("touch", "touch docked")); |
2184 #else | 2187 #else |
2185 INSTANTIATE_TEST_CASE_P(TabDragging, | 2188 INSTANTIATE_TEST_CASE_P(TabDragging, |
2186 DetachToBrowserTabDragControllerTest, | 2189 DetachToBrowserTabDragControllerTest, |
2187 ::testing::Values("mouse")); | 2190 ::testing::Values("mouse")); |
2188 #endif | 2191 #endif |
OLD | NEW |