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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc

Issue 2861873002: Align the base of the shelf's context menu to the top edge of the shelf. (Closed)
Patch Set: nits. Created 3 years, 7 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/shelf/shelf_view.cc ('k') | ui/views/controls/menu/menu_controller.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 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
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
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 }
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698