diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 20:47:17 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-06 20:47:17 +0000 |
commit | 869f63584313127e61ba26413a1fca3fa66c7819 (patch) | |
tree | 4aa76974e20c0efdf966d4f51e45ee7dafc173b3 /ash/root_window_controller_unittest.cc | |
parent | 69793ad506993edd0330fa52a81ad80ca280d0fb (diff) | |
download | chromium_src-869f63584313127e61ba26413a1fca3fa66c7819.zip chromium_src-869f63584313127e61ba26413a1fca3fa66c7819.tar.gz chromium_src-869f63584313127e61ba26413a1fca3fa66c7819.tar.bz2 |
Get some of the ash_unittests to run without crashing.
We currently make it as far as RootWindowControllerTest.MoveWindows_Basic.
This CL:
- changes ui::EventTarget::CanAcceptEvents to be CanAcceptEvent and take an event. This allows the event type to determine whether or not it can be accepted by the target.
- copy-pasta from ActivationController to AshActivationRules (GetNextWindowToActivate())
- forwarding to target handler for generic events in EventTarget
- RootWindowControllerTest needs to handle activation events @ the target and forward to OnBlur impl.
http://crbug.com/162100
R=sadrul@chromium.org
Review URL: https://codereview.chromium.org/11445023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/root_window_controller_unittest.cc')
-rw-r--r-- | ash/root_window_controller_unittest.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index e8f5763..2635d12 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc @@ -21,6 +21,7 @@ #include "ui/aura/window.h" #include "ui/aura/window_tracker.h" #include "ui/views/controls/menu/menu_controller.h" +#include "ui/views/corewm/focus_change_event.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -53,6 +54,7 @@ class DeleteOnBlurDelegate : public aura::test::TestWindowDelegate { void set_window(aura::Window* window) { window_ = window; } + private: // aura::test::TestWindowDelegate overrides: virtual bool CanFocus() OVERRIDE { return true; @@ -61,7 +63,15 @@ class DeleteOnBlurDelegate : public aura::test::TestWindowDelegate { delete window_; } - private: + // ui::EventHandler overrides: + virtual void OnEvent(ui::Event* event) OVERRIDE { + if (event->type() == + views::corewm::FocusChangeEvent::focus_changing_event_type()) { + if (event->target() == window_) + OnBlur(); + } + } + aura::Window* window_; DISALLOW_COPY_AND_ASSIGN(DeleteOnBlurDelegate); |