summaryrefslogtreecommitdiffstats
path: root/ash/shell_unittest.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-12 00:29:58 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-12 00:29:58 +0000
commitd10f5ae36b4ff727fe78ed10c9ca5673ad36fcb2 (patch)
tree493e30615d2f3f8353884d89d0bbe7a71aab44b0 /ash/shell_unittest.cc
parent6c16475940a16572e1ecd093b96f6ad1e282725a (diff)
downloadchromium_src-d10f5ae36b4ff727fe78ed10c9ca5673ad36fcb2.zip
chromium_src-d10f5ae36b4ff727fe78ed10c9ca5673ad36fcb2.tar.gz
chromium_src-d10f5ae36b4ff727fe78ed10c9ca5673ad36fcb2.tar.bz2
chromeos: Simplify how chrome keeps track of caps lock state.
Notable changes: * Make caps-lock related tray-item explicitly chromeos-only, since there has never been an implementation of CapsLockDelegate for other platforms. * As a result, have the tray-item directly communicate with XKeyboard, instead of needing the CapsLockDelegate, so delete it. * Have the code that needs to know when the caps-lock state changes (e.g. TrayCapsLock, SigninScreenHandler) use a pre-target handler on Shell and look for VKEY_CAPITAL key-press events. This simplifies the code, which currently flows from: X11 -> SystemKeyEventListener -> SystemTrayDelegate -> SystemTrayNotifier -> TrayCapsLock to: X11 -> WindowTreeHost -> TrayCapsLock BUG=none R=derat@chromium.org, oshima@chromium.org, yusukes@chromium.org TBR=nkostylev@chromium.org for c/b/ui/webui/chromeos/login changes Review URL: https://codereview.chromium.org/192293004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r--ash/shell_unittest.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 160d6b4..8b00092 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -496,14 +496,22 @@ TEST_F(ShellTest, ToggleAutoHide) {
shell->GetShelfAutoHideBehavior(root_window));
}
+// Tests that the cursor-filter is ahead of the drag-drop controller in the
+// pre-target list.
TEST_F(ShellTest, TestPreTargetHandlerOrder) {
Shell* shell = Shell::GetInstance();
ui::EventTargetTestApi 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());
+ ui::EventHandlerList::const_iterator cursor_filter =
+ std::find(handlers.begin(), handlers.end(), shell->mouse_cursor_filter());
+ ui::EventHandlerList::const_iterator drag_drop =
+ std::find(handlers.begin(), handlers.end(),
+ shell_test_api.drag_drop_controller());
+ EXPECT_NE(handlers.end(), cursor_filter);
+ EXPECT_NE(handlers.end(), drag_drop);
+ EXPECT_GT(drag_drop, cursor_filter);
}
// Verifies an EventHandler added to Env gets notified from EventGenerator.