| OLD | NEW |
| 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "chrome/browser/ui/views/menu_test_base.h" | 6 #include "chrome/browser/ui/views/menu_test_base.h" |
| 7 #include "chrome/test/base/interactive_test_utils.h" | 7 #include "chrome/test/base/interactive_test_utils.h" |
| 8 #include "ui/base/dragdrop/drag_drop_types.h" | 8 #include "ui/base/dragdrop/drag_drop_types.h" |
| 9 #include "ui/base/dragdrop/os_exchange_data.h" | 9 #include "ui/base/dragdrop/os_exchange_data.h" |
| 10 #include "ui/views/controls/menu/menu_controller.h" | 10 #include "ui/views/controls/menu/menu_controller.h" |
| 11 #include "ui/views/controls/menu/menu_item_view.h" | 11 #include "ui/views/controls/menu/menu_item_view.h" |
| 12 #include "ui/views/controls/menu/menu_runner.h" | 12 #include "ui/views/controls/menu/menu_runner.h" |
| 13 #include "ui/views/controls/menu/submenu_view.h" | 13 #include "ui/views/controls/menu/submenu_view.h" |
| 14 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // Borrowed from chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc, | 18 // Borrowed from chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc, |
| 19 // since these are also disabled on Linux for drag and drop. | 19 // since these are also disabled on Linux for drag and drop. |
| 20 // TODO(erg): Fix DND tests on linux_aura. crbug.com/163931 | 20 // TODO(erg): Fix DND tests on linux_aura. http://crbug.com/163931 |
| 21 #if defined(OS_LINUX) && defined(USE_AURA) | 21 // TODO(enne): Windows version has flaky timeouts. http://crbug.com/401226 |
| 22 #if defined(USE_AURA) |
| 22 #define MAYBE(x) DISABLED_##x | 23 #define MAYBE(x) DISABLED_##x |
| 23 #else | 24 #else |
| 24 #define MAYBE(x) x | 25 #define MAYBE(x) x |
| 25 #endif | 26 #endif |
| 26 | 27 |
| 27 const char kTestNestedDragData[] = "test_nested_drag_data"; | 28 const char kTestNestedDragData[] = "test_nested_drag_data"; |
| 28 const char kTestTopLevelDragData[] = "test_top_level_drag_data"; | 29 const char kTestTopLevelDragData[] = "test_top_level_drag_data"; |
| 29 | 30 |
| 30 // A simple view which can be dragged. | 31 // A simple view which can be dragged. |
| 31 class TestDragView : public views::View { | 32 class TestDragView : public views::View { |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 views::MenuController* controller = menu()->GetMenuController(); | 506 views::MenuController* controller = menu()->GetMenuController(); |
| 506 ASSERT_TRUE(controller); | 507 ASSERT_TRUE(controller); |
| 507 EXPECT_TRUE(controller->IsCancelAllTimerRunningForTest()); | 508 EXPECT_TRUE(controller->IsCancelAllTimerRunningForTest()); |
| 508 | 509 |
| 509 Done(); | 510 Done(); |
| 510 } | 511 } |
| 511 | 512 |
| 512 // Test that if a menu is opened for a drop handled entirely by menu code, the | 513 // Test that if a menu is opened for a drop handled entirely by menu code, the |
| 513 // menu will try to close if it does not receive any drag updates. | 514 // menu will try to close if it does not receive any drag updates. |
| 514 VIEW_TEST(MenuViewDragAndDropForDropCancel, MenuViewCancelsForOwnDrag) | 515 VIEW_TEST(MenuViewDragAndDropForDropCancel, MenuViewCancelsForOwnDrag) |
| OLD | NEW |