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

Side by Side Diff: ui/views/controls/menu/menu_controller_unittest.cc

Issue 2323553002: mash: Use the new mus drag and drop API to get drag working in mash. (Closed)
Patch Set: another make unique Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 MenuItemView* run_result = 1386 MenuItemView* run_result =
1387 controller->Run(nullptr, nullptr, menu_item(), gfx::Rect(), 1387 controller->Run(nullptr, nullptr, menu_item(), gfx::Rect(),
1388 MENU_ANCHOR_TOPLEFT, false, false, &mouse_event_flags); 1388 MENU_ANCHOR_TOPLEFT, false, false, &mouse_event_flags);
1389 EXPECT_EQ(run_result, nullptr); 1389 EXPECT_EQ(run_result, nullptr);
1390 } 1390 }
1391 1391
1392 // Tests that if a MenuController is destroying during drag/drop, and another 1392 // Tests that if a MenuController is destroying during drag/drop, and another
1393 // MenuController becomes active, that the exiting of drag does not cause a 1393 // MenuController becomes active, that the exiting of drag does not cause a
1394 // crash. 1394 // crash.
1395 TEST_F(MenuControllerTest, MenuControllerReplacedDuringDrag) { 1395 TEST_F(MenuControllerTest, MenuControllerReplacedDuringDrag) {
1396 // This test creates two native widgets, but expects the child native widget
1397 // to be able to reach up and use the parent native widget's aura
1398 // objects. https://crbug.com/614037
1399 if (IsMus())
1400 return;
1401
1396 TestDragDropClient drag_drop_client( 1402 TestDragDropClient drag_drop_client(
1397 base::Bind(&MenuControllerTest::TestMenuControllerReplacementDuringDrag, 1403 base::Bind(&MenuControllerTest::TestMenuControllerReplacementDuringDrag,
1398 base::Unretained(this))); 1404 base::Unretained(this)));
1399 aura::client::SetDragDropClient(owner()->GetNativeWindow()->GetRootWindow(), 1405 aura::client::SetDragDropClient(owner()->GetNativeWindow()->GetRootWindow(),
1400 &drag_drop_client); 1406 &drag_drop_client);
1401 AddButtonMenuItems(); 1407 AddButtonMenuItems();
1402 StartDrag(); 1408 StartDrag();
1403 } 1409 }
1404 1410
1405 #endif // defined(USE_AURA) 1411 #endif // defined(USE_AURA)
1406 1412
1407 } // namespace test 1413 } // namespace test
1408 } // namespace views 1414 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698