OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
6 #include "ash/shelf/shelf_view.h" | 6 #include "ash/shelf/shelf_view.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/shelf_test_api.h" | 8 #include "ash/test/shelf_test_api.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #endif | 77 #endif |
78 | 78 |
79 IN_PROC_BROWSER_TEST_F(WindowSizerTest, | 79 IN_PROC_BROWSER_TEST_F(WindowSizerTest, |
80 MAYBE_OpenBrowserUsingShelfOnOtherDisplay) { | 80 MAYBE_OpenBrowserUsingShelfOnOtherDisplay) { |
81 // Don't shutdown when closing the last browser window. | 81 // Don't shutdown when closing the last browser window. |
82 chrome::IncrementKeepAliveCount(); | 82 chrome::IncrementKeepAliveCount(); |
83 | 83 |
84 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); | 84 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); |
85 | 85 |
86 BrowserList* browser_list = | 86 BrowserList* browser_list = |
87 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 87 BrowserList::GetInstance(ui::HOST_DESKTOP_TYPE_ASH); |
88 | 88 |
89 EXPECT_EQ(1u, browser_list->size()); | 89 EXPECT_EQ(1u, browser_list->size()); |
90 // Close the browser window so that clicking icon will create a new window. | 90 // Close the browser window so that clicking icon will create a new window. |
91 CloseBrowser(browser_list->get(0)); | 91 CloseBrowser(browser_list->get(0)); |
92 EXPECT_EQ(0u, browser_list->size()); | 92 EXPECT_EQ(0u, browser_list->size()); |
93 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); | 93 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); |
94 | 94 |
95 OpenBrowserUsingShelfOnRootWindow(root_windows[1]); | 95 OpenBrowserUsingShelfOnRootWindow(root_windows[1]); |
96 | 96 |
97 // A new browser must be created on 2nd display. | 97 // A new browser must be created on 2nd display. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, | 166 IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, |
167 MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay) { | 167 MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay) { |
168 // Don't shutdown when closing the last browser window. | 168 // Don't shutdown when closing the last browser window. |
169 chrome::IncrementKeepAliveCount(); | 169 chrome::IncrementKeepAliveCount(); |
170 | 170 |
171 views::MenuController::TurnOffMenuSelectionHoldForTest(); | 171 views::MenuController::TurnOffMenuSelectionHoldForTest(); |
172 | 172 |
173 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); | 173 aura::Window::Windows root_windows = ash::Shell::GetAllRootWindows(); |
174 | 174 |
175 BrowserList* browser_list = | 175 BrowserList* browser_list = |
176 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 176 BrowserList::GetInstance(ui::HOST_DESKTOP_TYPE_ASH); |
177 | 177 |
178 ASSERT_EQ(1u, browser_list->size()); | 178 ASSERT_EQ(1u, browser_list->size()); |
179 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); | 179 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); |
180 CloseBrowser(browser_list->get(0)); | 180 CloseBrowser(browser_list->get(0)); |
181 | 181 |
182 OpenBrowserUsingContextMenuOnRootWindow(root_windows[1]); | 182 OpenBrowserUsingContextMenuOnRootWindow(root_windows[1]); |
183 | 183 |
184 // A new browser must be created on 2nd display. | 184 // A new browser must be created on 2nd display. |
185 ASSERT_EQ(1u, browser_list->size()); | 185 ASSERT_EQ(1u, browser_list->size()); |
186 EXPECT_EQ(root_windows[1], | 186 EXPECT_EQ(root_windows[1], |
187 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); | 187 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); |
188 EXPECT_EQ(root_windows[1], ash::Shell::GetTargetRootWindow()); | 188 EXPECT_EQ(root_windows[1], ash::Shell::GetTargetRootWindow()); |
189 | 189 |
190 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); | 190 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); |
191 | 191 |
192 // Next new browser must be created on 1st display. | 192 // Next new browser must be created on 1st display. |
193 ASSERT_EQ(2u, browser_list->size()); | 193 ASSERT_EQ(2u, browser_list->size()); |
194 EXPECT_EQ(root_windows[0], | 194 EXPECT_EQ(root_windows[0], |
195 browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow()); | 195 browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow()); |
196 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); | 196 EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); |
197 | 197 |
198 // Balanced with the chrome::IncrementKeepAliveCount above. | 198 // Balanced with the chrome::IncrementKeepAliveCount above. |
199 chrome::DecrementKeepAliveCount(); | 199 chrome::DecrementKeepAliveCount(); |
200 } | 200 } |
OLD | NEW |