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_view.h" | 5 #include "ash/shelf/shelf_view.h" |
6 #include "ash/shelf/wm_shelf.h" | 6 #include "ash/shelf/wm_shelf.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm_window.h" | 8 #include "ash/wm_window.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 private: | 158 private: |
159 DISALLOW_COPY_AND_ASSIGN(WindowSizerContextMenuTest); | 159 DISALLOW_COPY_AND_ASSIGN(WindowSizerContextMenuTest); |
160 }; | 160 }; |
161 | 161 |
162 void OpenBrowserUsingContextMenuOnRootWindow(aura::Window* root_window) { | 162 void OpenBrowserUsingContextMenuOnRootWindow(aura::Window* root_window) { |
163 gfx::Point chrome_icon = | 163 gfx::Point chrome_icon = |
164 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); | 164 GetChromeIconBoundsForRootWindow(root_window).CenterPoint(); |
165 gfx::Point release_point = chrome_icon; | 165 gfx::Point release_point = chrome_icon; |
166 release_point.Offset(50, -120); | 166 // -153 moves the cursor up to the "New window" menu option. |
| 167 release_point.Offset(0, -153); |
167 ui_controls::SendMouseMoveNotifyWhenDone( | 168 ui_controls::SendMouseMoveNotifyWhenDone( |
168 chrome_icon.x(), chrome_icon.y(), | 169 chrome_icon.x(), chrome_icon.y(), |
169 base::Bind(&WindowSizerContextMenuTest::Step1, release_point)); | 170 base::Bind(&WindowSizerContextMenuTest::Step1, release_point)); |
170 base::RunLoop().Run(); | 171 base::RunLoop().Run(); |
171 } | 172 } |
172 | 173 |
173 } // namespace | 174 } // namespace |
174 | 175 |
175 IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, | 176 IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, |
176 MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay) { | 177 MAYBE_OpenBrowserUsingContextMenuOnOtherDisplay) { |
(...skipping 21 matching lines...) Expand all Loading... |
198 | 199 |
199 CloseBrowser(browser_list->get(0)); | 200 CloseBrowser(browser_list->get(0)); |
200 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); | 201 OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); |
201 | 202 |
202 // Next new browser must be created on 1st display. | 203 // Next new browser must be created on 1st display. |
203 ASSERT_EQ(1u, browser_list->size()); | 204 ASSERT_EQ(1u, browser_list->size()); |
204 EXPECT_EQ(root_windows[0], | 205 EXPECT_EQ(root_windows[0], |
205 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); | 206 browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); |
206 EXPECT_EQ(root_windows[0], ash::Shell::GetRootWindowForNewWindows()); | 207 EXPECT_EQ(root_windows[0], ash::Shell::GetRootWindowForNewWindows()); |
207 } | 208 } |
OLD | NEW |