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

Unified Diff: ui/views/controls/menu/menu_controller_unittest.cc

Issue 2722193003: Update MenuControllerTest Widget Creation (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller_unittest.cc
diff --git a/ui/views/controls/menu/menu_controller_unittest.cc b/ui/views/controls/menu/menu_controller_unittest.cc
index 5d918d338853938de4e5ba5c4a281facf9f2653b..d00f3d48fca6049e6afb510e034663063126333c 100644
--- a/ui/views/controls/menu/menu_controller_unittest.cc
+++ b/ui/views/controls/menu/menu_controller_unittest.cc
@@ -1502,16 +1502,18 @@ TEST_F(MenuControllerTest, RunWithoutWidgetDoesntCrash) {
// MenuController becomes active, that the exiting of drag does not cause a
// crash.
TEST_F(MenuControllerTest, MenuControllerReplacedDuringDrag) {
- // TODO: this test wedges with aura-mus-client. http://crbug.com/664280.
- if (IsMus())
- return;
-
+ // Build the menu so that the appropriate root window is available to set the
+ // drag drop client on.
+ AddButtonMenuItems();
TestDragDropClient drag_drop_client(
base::Bind(&MenuControllerTest::TestMenuControllerReplacementDuringDrag,
base::Unretained(this)));
- aura::client::SetDragDropClient(owner()->GetNativeWindow()->GetRootWindow(),
+ aura::client::SetDragDropClient(menu_item()
+ ->GetSubmenu()
+ ->GetWidget()
+ ->GetNativeWindow()
+ ->GetRootWindow(),
&drag_drop_client);
- AddButtonMenuItems();
StartDrag();
}
@@ -1519,18 +1521,20 @@ TEST_F(MenuControllerTest, MenuControllerReplacedDuringDrag) {
// destroy the MenuController. On Windows and Linux this destruction also
// destroys the Widget used for drag-and-drop, thereby ending the drag.
TEST_F(MenuControllerTest, CancelAllDuringDrag) {
- // TODO: this test wedges with aura-mus-client. http://crbug.com/664280.
- if (IsMus())
- return;
-
MenuController* controller = menu_controller();
controller->SetAsyncRun(true);
+ // Build the menu so that the appropriate root window is available to set the
+ // drag drop client on.
+ AddButtonMenuItems();
TestDragDropClient drag_drop_client(base::Bind(
&MenuControllerTest::TestCancelAllDuringDrag, base::Unretained(this)));
- aura::client::SetDragDropClient(owner()->GetNativeWindow()->GetRootWindow(),
+ aura::client::SetDragDropClient(menu_item()
+ ->GetSubmenu()
+ ->GetWidget()
+ ->GetNativeWindow()
+ ->GetRootWindow(),
&drag_drop_client);
- AddButtonMenuItems();
StartDrag();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698