diff options
author | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 21:46:44 +0000 |
---|---|---|
committer | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-06 21:46:44 +0000 |
commit | c086babf8788773e9f632c0c8a7623d7f85cbf13 (patch) | |
tree | 518f7c21e8d01380410efba7853819a5a9179802 /ash/shell_unittest.cc | |
parent | fdfb270bc229a55c2a5042139f03f9d8a5438fef (diff) | |
download | chromium_src-c086babf8788773e9f632c0c8a7623d7f85cbf13.zip chromium_src-c086babf8788773e9f632c0c8a7623d7f85cbf13.tar.gz chromium_src-c086babf8788773e9f632c0c8a7623d7f85cbf13.tar.bz2 |
Change ordering of Shell event handlers:
crrev.com/14184010 made the DragDropController to be the first handler everytime
a drag starts. That was done under the assumption that once we are in a drag
drop session, no other handler needs to see the event. This assumption turned
out to be false because the MouseCursorEventFilter needs to handle events even
during a drag drop session so that the cursor can move across displays (causing
the bug listed below). Hence, we make the DragDropController the second event
handler while MouseCursorEvedntFilter becomes the first.
BUG=244508
Review URL: https://chromiumcodereview.appspot.com/16463002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r-- | ash/shell_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index be1d1cd..d059091 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc @@ -9,6 +9,8 @@ #include "ash/ash_switches.h" #include "ash/desktop_background/desktop_background_widget_controller.h" +#include "ash/display/mouse_cursor_event_filter.h" +#include "ash/drag_drop/drag_drop_controller.h" #include "ash/launcher/launcher.h" #include "ash/root_window_controller.h" #include "ash/session_state_delegate.h" @@ -16,6 +18,7 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell_window_ids.h" #include "ash/test/ash_test_base.h" +#include "ash/test/shell_test_api.h" #include "ash/wm/root_window_layout_manager.h" #include "ash/wm/window_util.h" #include "base/utf_string_conversions.h" @@ -423,6 +426,16 @@ TEST_F(ShellTest, ToggleAutoHide) { shell->GetShelfAutoHideBehavior(root_window)); } +TEST_F(ShellTest, TestPreTargetHandlerOrder) { + Shell* shell = Shell::GetInstance(); + Shell::TestApi test_api(shell); + test::ShellTestApi shell_test_api(shell); + + const ui::EventHandlerList& handlers = test_api.pre_target_handlers(); + EXPECT_EQ(handlers[0], shell->mouse_cursor_filter()); + EXPECT_EQ(handlers[1], shell_test_api.drag_drop_controller()); +} + // This verifies WindowObservers are removed when a window is destroyed after // the Shell is destroyed. This scenario (aura::Windows being deleted after the // Shell) occurs if someone is holding a reference to an unparented Window, as |