summaryrefslogtreecommitdiffstats
path: root/aura
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-30 18:52:44 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-30 18:52:44 +0000
commit1c34932902e6462e70980112ee045907492602c8 (patch)
treebb09aa097f0d2e1b386fc72456dee059c73bd32f /aura
parent08858317710b1f9df9ebb786f7481cf7c6e0dbbe (diff)
downloadchromium_src-1c34932902e6462e70980112ee045907492602c8.zip
chromium_src-1c34932902e6462e70980112ee045907492602c8.tar.gz
chromium_src-1c34932902e6462e70980112ee045907492602c8.tar.bz2
Revert 98850 - Proper MouseEvent targeting. Adds a Window method that locates a Window for a given point.
Also adds an Aura test suite. http://crbug.com/93933 http://crbug.com/93943 TEST=see unittest Review URL: http://codereview.chromium.org/7791030 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/7739002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'aura')
-rw-r--r--aura/aura.gyp26
-rw-r--r--aura/demo/demo_main.cc6
-rw-r--r--aura/desktop.cc16
-rw-r--r--aura/desktop.h11
-rw-r--r--aura/desktop_host.h3
-rw-r--r--aura/desktop_host_win.cc11
-rw-r--r--aura/desktop_host_win.h1
-rw-r--r--aura/event.cc15
-rw-r--r--aura/event.h12
-rw-r--r--aura/root_window.cc35
-rw-r--r--aura/root_window.h33
-rw-r--r--aura/run_all_unittests.cc9
-rw-r--r--aura/test_suite.cc32
-rw-r--r--aura/test_suite.h22
-rw-r--r--aura/window.cc32
-rw-r--r--aura/window.h18
-rw-r--r--aura/window_delegate.h10
-rw-r--r--aura/window_unittest.cc124
18 files changed, 11 insertions, 405 deletions
diff --git a/aura/aura.gyp b/aura/aura.gyp
index a304860..fa76c99 100644
--- a/aura/aura.gyp
+++ b/aura/aura.gyp
@@ -29,8 +29,6 @@
'event.cc',
'event.h',
'event_win.cc',
- 'root_window.cc',
- 'root_window.h',
'window.cc',
'window.h',
'window_delegate.h',
@@ -60,29 +58,5 @@
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.rc',
],
},
- {
- 'target_name': 'aura_unittests',
- 'type': 'executable',
- 'dependencies': [
- '<(DEPTH)/base/base.gyp:test_support_base',
- '<(DEPTH)/skia/skia.gyp:skia',
- '<(DEPTH)/testing/gtest.gyp:gtest',
- '<(DEPTH)/ui/ui.gyp:gfx_resources',
- '<(DEPTH)/ui/ui.gyp:ui',
- '<(DEPTH)/ui/ui.gyp:ui_resources',
- 'aura',
- ],
- 'include_dirs': [
- '..',
- ],
- 'sources': [
- 'window_unittest.cc',
- 'run_all_unittests.cc',
- 'test_suite.cc',
- 'test_suite.h',
- '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.rc',
- '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.rc',
- ],
- },
],
}
diff --git a/aura/demo/demo_main.cc b/aura/demo/demo_main.cc
index a0758c5..09cfc29 100644
--- a/aura/demo/demo_main.cc
+++ b/aura/demo/demo_main.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "aura/desktop.h"
-#include "aura/event.h"
#include "aura/window.h"
#include "aura/window_delegate.h"
#include "base/at_exit.h"
@@ -13,6 +12,7 @@
#include "third_party/skia/include/core/SkXfermode.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/rect.h"
@@ -23,10 +23,6 @@ class DemoWindowDelegate : public aura::WindowDelegate {
public:
explicit DemoWindowDelegate(SkColor color) : color_(color) {}
- virtual bool OnMouseEvent(const aura::MouseEvent& event) OVERRIDE {
- return true;
- }
-
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
canvas->AsCanvasSkia()->drawColor(color_, SkXfermode::kSrc_Mode);
}
diff --git a/aura/desktop.cc b/aura/desktop.cc
index 2bac955..f427daf 100644
--- a/aura/desktop.cc
+++ b/aura/desktop.cc
@@ -5,7 +5,6 @@
#include "aura/desktop.h"
#include "aura/desktop_host.h"
-#include "aura/root_window.h"
#include "aura/window.h"
#include "base/logging.h"
#include "base/message_loop.h"
@@ -22,34 +21,27 @@ Desktop::Desktop()
host_->GetSize());
host_->SetDesktop(this);
DCHECK(compositor_.get());
- window_.reset(new internal::RootWindow);
+ window_.reset(new Window(NULL));
}
Desktop::~Desktop() {
}
-void Desktop::Show() {
- host_->Show();
-}
-
-void Desktop::SetSize(const gfx::Size& size) {
- host_->SetSize(size);
-}
-
void Desktop::Run() {
- Show();
+ host_->Show();
MessageLoop main_message_loop(MessageLoop::TYPE_UI);
MessageLoopForUI::current()->Run(host_);
}
void Desktop::Draw() {
+ // Second pass renders the layers.
compositor_->NotifyStart();
window_->DrawTree();
compositor_->NotifyEnd();
}
bool Desktop::OnMouseEvent(const MouseEvent& event) {
- return window_->HandleMouseEvent(event);
+ return window_->OnMouseEvent(event);
}
// static
diff --git a/aura/desktop.h b/aura/desktop.h
index 3139cae..a894e24 100644
--- a/aura/desktop.h
+++ b/aura/desktop.h
@@ -6,7 +6,7 @@
#define AURA_DESKTOP_H_
#pragma once
-#include "aura/root_window.h"
+#include "aura/window.h"
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "ui/gfx/native_widget_types.h"
@@ -23,6 +23,7 @@ namespace aura {
class DesktopHost;
class MouseEvent;
+class Window;
// Desktop is responsible for hosting a set of windows.
class Desktop {
@@ -30,12 +31,6 @@ class Desktop {
Desktop();
~Desktop();
- // Shows the desktop host.
- void Show();
-
- // Sets the size of the desktop.
- void SetSize(const gfx::Size& size);
-
// Shows the desktop host and runs an event loop for it.
void Run();
@@ -55,7 +50,7 @@ class Desktop {
private:
scoped_refptr<ui::Compositor> compositor_;
- scoped_ptr<internal::RootWindow> window_;
+ scoped_ptr<Window> window_;
DesktopHost* host_;
diff --git a/aura/desktop_host.h b/aura/desktop_host.h
index ad60f40..f7ba295 100644
--- a/aura/desktop_host.h
+++ b/aura/desktop_host.h
@@ -37,9 +37,8 @@ class DesktopHost : public MessageLoop::Dispatcher {
// Shows the DesktopHost.
virtual void Show() = 0;
- // Gets/Sets the size of the DesktopHost.
+ // Returns the size of the DesktopHost.
virtual gfx::Size GetSize() = 0;
- virtual void SetSize(const gfx::Size& size) = 0;
};
} // namespace aura
diff --git a/aura/desktop_host_win.cc b/aura/desktop_host_win.cc
index d922221..f235b6e 100644
--- a/aura/desktop_host_win.cc
+++ b/aura/desktop_host_win.cc
@@ -47,17 +47,6 @@ gfx::Size DesktopHostWin::GetSize() {
return gfx::Rect(r).size();
}
-void DesktopHostWin::SetSize(const gfx::Size& size) {
- SetWindowPos(
- hwnd(),
- NULL,
- 0,
- 0,
- size.width(),
- size.height(),
- SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION);
-}
-
void DesktopHostWin::OnClose() {
// TODO: this obviously shouldn't be here.
MessageLoopForUI::current()->Quit();
diff --git a/aura/desktop_host_win.h b/aura/desktop_host_win.h
index 185cf1f..6a8165b 100644
--- a/aura/desktop_host_win.h
+++ b/aura/desktop_host_win.h
@@ -25,7 +25,6 @@ class DesktopHostWin : public DesktopHost, public ui::WindowImpl {
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
virtual void Show() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
- virtual void SetSize(const gfx::Size& size) OVERRIDE;
private:
BEGIN_MSG_MAP_EX(DesktopHostWin)
diff --git a/aura/event.cc b/aura/event.cc
index 055f004..2a62a4c 100644
--- a/aura/event.cc
+++ b/aura/event.cc
@@ -4,8 +4,6 @@
#include "aura/event.h"
-#include "aura/window.h"
-
namespace aura {
Event::Event(ui::EventType type, int flags)
@@ -29,18 +27,5 @@ Event::Event(const Event& copy)
flags_(copy.flags_) {
}
-LocatedEvent::LocatedEvent(const LocatedEvent& model,
- Window* source,
- Window* target)
- : Event(model),
- location_(model.location_) {
- if (target && target != source)
- Window::ConvertPointToWindow(source, target, &location_);
-}
-
-MouseEvent::MouseEvent(const MouseEvent& model, Window* source, Window* target)
- : LocatedEvent(model, source, target) {
-}
-
} // namespace aura
diff --git a/aura/event.h b/aura/event.h
index be08345..27a8f30 100644
--- a/aura/event.h
+++ b/aura/event.h
@@ -21,8 +21,6 @@ typedef union _XEvent XEvent;
typedef XEvent* NativeEvent;
#endif
-class Window;
-
class Event {
public:
const NativeEvent& native_event() const { return native_event_; }
@@ -57,11 +55,6 @@ class LocatedEvent : public Event {
protected:
explicit LocatedEvent(NativeEvent native_event);
- // Create a new LocatedEvent which is identical to the provided model.
- // If source / target windows are provided, the model location will be
- // converted from |source| coordinate system to |target| coordinate system.
- LocatedEvent(const LocatedEvent& model, Window* source, Window* target);
-
gfx::Point location_;
private:
@@ -72,11 +65,6 @@ class MouseEvent : public LocatedEvent {
public:
explicit MouseEvent(NativeEvent native_event);
- // Create a new MouseEvent which is identical to the provided model.
- // If source / target windows are provided, the model location will be
- // converted from |source| coordinate system to |target| coordinate system.
- MouseEvent(const MouseEvent& model, Window* source, Window* target);
-
private:
DISALLOW_COPY_AND_ASSIGN(MouseEvent);
};
diff --git a/aura/root_window.cc b/aura/root_window.cc
deleted file mode 100644
index 6e3df25..0000000
--- a/aura/root_window.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "aura/root_window.h"
-
-#include "base/logging.h"
-#include "aura/event.h"
-#include "aura/window_delegate.h"
-#include "ui/base/events.h"
-
-namespace aura {
-namespace internal {
-
-RootWindow::RootWindow() : Window(NULL), mouse_pressed_handler_(NULL) {
-}
-
-RootWindow::~RootWindow() {
-}
-
-bool RootWindow::HandleMouseEvent(const MouseEvent& event) {
- Window* target = mouse_pressed_handler_;
- if (!target)
- target = GetEventHandlerForPoint(event.location());
- if (event.type() == ui::ET_MOUSE_PRESSED && !mouse_pressed_handler_)
- mouse_pressed_handler_ = target;
- if (target->delegate()) {
- MouseEvent translated_event(event, this, target);
- return target->delegate()->OnMouseEvent(translated_event);
- }
- return false;
-}
-
-} // namespace internal
-} // namespace aura
diff --git a/aura/root_window.h b/aura/root_window.h
deleted file mode 100644
index e2f02fd..0000000
--- a/aura/root_window.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef AURA_ROOT_WINDOW_H_
-#define AURA_ROOT_WINDOW_H_
-#pragma once
-
-#include "aura/window.h"
-
-namespace aura {
-namespace internal {
-
-// A Window subclass that handles event targeting for certain types of
-// MouseEvent.
-class RootWindow : public Window {
- public:
- RootWindow();
- virtual ~RootWindow();
-
- // Handles a mouse event. Returns true if handled.
- bool HandleMouseEvent(const MouseEvent& event);
-
- private:
- Window* mouse_pressed_handler_;
-
- DISALLOW_COPY_AND_ASSIGN(RootWindow);
-};
-
-} // namespace internal
-} // namespace aura
-
-#endif // AURA_ROOT_WINDOW_H_
diff --git a/aura/run_all_unittests.cc b/aura/run_all_unittests.cc
deleted file mode 100644
index 5afef6d..0000000
--- a/aura/run_all_unittests.cc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "aura/test_suite.h"
-
-int main(int argc, char** argv) {
- return AuraTestSuite(argc, argv).Run();
-}
diff --git a/aura/test_suite.cc b/aura/test_suite.cc
deleted file mode 100644
index 54165f3..0000000
--- a/aura/test_suite.cc
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "aura/test_suite.h"
-
-#include "base/file_path.h"
-#include "base/path_service.h"
-#include "build/build_config.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/ui_base_paths.h"
-#include "ui/gfx/gfx_paths.h"
-
-AuraTestSuite::AuraTestSuite(int argc, char** argv)
- : TestSuite(argc, argv) {}
-
-void AuraTestSuite::Initialize() {
- base::TestSuite::Initialize();
-
- gfx::RegisterPathProvider();
- ui::RegisterPathProvider();
-
- // Force unittests to run using en-US so if we test against string
- // output, it'll pass regardless of the system language.
- ui::ResourceBundle::InitSharedInstance("en-US");
-}
-
-void AuraTestSuite::Shutdown() {
- ui::ResourceBundle::CleanupSharedInstance();
-
- base::TestSuite::Shutdown();
-}
diff --git a/aura/test_suite.h b/aura/test_suite.h
deleted file mode 100644
index 43465a5..0000000
--- a/aura/test_suite.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef AURA_TEST_SUITE_H_
-#define AURA_TEST_SUITE_H_
-#pragma once
-
-#include "base/compiler_specific.h"
-#include "base/test/test_suite.h"
-
-class AuraTestSuite : public base::TestSuite {
- public:
- AuraTestSuite(int argc, char** argv);
-
- protected:
- // base::TestSuite:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
-};
-
-#endif // AURA_TEST_SUITE_H_
diff --git a/aura/window.cc b/aura/window.cc
index 5a81bfe..e6f62a8 100644
--- a/aura/window.cc
+++ b/aura/window.cc
@@ -24,10 +24,6 @@ Window::Window(WindowDelegate* delegate)
}
Window::~Window() {
- if (delegate_)
- delegate_->OnWindowDestroyed();
- if (parent_)
- parent_->RemoveChild(this);
}
void Window::Init() {
@@ -74,6 +70,7 @@ void Window::DrawTree() {
UpdateLayerCanvas();
Draw();
+ // First pass updates the layer bitmaps.
for (Windows::iterator i = children_.begin(); i != children_.end(); ++i)
(*i)->DrawTree();
}
@@ -94,37 +91,10 @@ void Window::RemoveChild(Window* child) {
children_.erase(i);
}
-// static
-void Window::ConvertPointToWindow(Window* source,
- Window* target,
- gfx::Point* point) {
- ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point);
-}
-
bool Window::OnMouseEvent(const MouseEvent& event) {
return true;
}
-bool Window::HitTest(const gfx::Point& point) {
- gfx::Rect local_bounds(gfx::Point(), bounds().size());
- // TODO(beng): hittest masks.
- return local_bounds.Contains(point);
-}
-
-Window* Window::GetEventHandlerForPoint(const gfx::Point& point) {
- Windows::const_reverse_iterator i = children_.rbegin();
- for (; i != children_.rend(); ++i) {
- Window* child = *i;
- if (child->visibility() == Window::VISIBILITY_HIDDEN)
- continue;
- gfx::Point point_in_child_coords(point);
- Window::ConvertPointToWindow(this, child, &point_in_child_coords);
- if (child->HitTest(point_in_child_coords))
- return child->GetEventHandlerForPoint(point_in_child_coords);
- }
- return this;
-}
-
void Window::UpdateLayerCanvas() {
if (needs_paint_all_) {
needs_paint_all_ = false;
diff --git a/aura/window.h b/aura/window.h
index f5667b8..871ceb6 100644
--- a/aura/window.h
+++ b/aura/window.h
@@ -27,7 +27,6 @@ class WindowDelegate;
// Aura window implementation. Interesting events are sent to the
// WindowDelegate.
-// TODO(beng): resolve ownership.
class Window {
public:
enum Visibility {
@@ -81,26 +80,9 @@ class Window {
void AddChild(Window* child);
void RemoveChild(Window* child);
- static void ConvertPointToWindow(Window* source,
- Window* target,
- gfx::Point* point);
-
// Handles a mouse event. Returns true if handled.
bool OnMouseEvent(const MouseEvent& event);
- WindowDelegate* delegate() { return delegate_; }
-
- // Returns true if the mouse pointer at the specified |point| can trigger an
- // event for this Window.
- // TODO(beng):
- // A Window can supply a hit-test mask to cause some portions of itself to not
- // trigger events, causing the events to fall through to the Window behind.
- bool HitTest(const gfx::Point& point);
-
- // Returns the Window that most closely encloses |point| for the purposes of
- // event targeting.
- Window* GetEventHandlerForPoint(const gfx::Point& point);
-
private:
typedef std::vector<Window*> Windows;
diff --git a/aura/window_delegate.h b/aura/window_delegate.h
index 93ad8f5..ffa3191 100644
--- a/aura/window_delegate.h
+++ b/aura/window_delegate.h
@@ -12,19 +12,11 @@ class Canvas;
namespace aura {
-class MouseEvent;
-
// Delegate interface for aura::Window.
class WindowDelegate {
public:
- virtual bool OnMouseEvent(const MouseEvent& event) = 0;
-
// Asks the delegate to paint window contents into the supplied canvas.
- virtual void OnPaint(gfx::Canvas* canvas) = 0;
-
- // Called when the Window has been destroyed (i.e. from its destructor).
- // The delegate can use this as an opportunity to delete itself if necessary.
- virtual void OnWindowDestroyed() = 0;
+ virtual void OnPaint(gfx::Canvas* canvas) = 0;
protected:
virtual ~WindowDelegate() {}
diff --git a/aura/window_unittest.cc b/aura/window_unittest.cc
deleted file mode 100644
index 7e16519..0000000
--- a/aura/window_unittest.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "aura/desktop.h"
-#include "aura/window_delegate.h"
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/message_loop.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/canvas_skia.h"
-
-namespace aura {
-namespace internal {
-
-namespace {
-
-// A simple WindowDelegate implementation for these tests. It owns itself
-// (deletes itself when the Window it is attached to is destroyed).
-class TestWindowDelegate : public WindowDelegate {
- public:
- TestWindowDelegate(SkColor color) : color_(color) {}
- virtual ~TestWindowDelegate() {}
-
- // Overridden from WindowDelegate:
- virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE { return false; }
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
- canvas->AsCanvasSkia()->drawColor(color_, SkXfermode::kSrc_Mode);
- }
- virtual void OnWindowDestroyed() OVERRIDE {
- delete this;
- }
-
- private:
- SkColor color_;
-
- DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate);
-};
-
-class WindowTest : public testing::Test {
- public:
- WindowTest() {
- aura::Desktop::GetInstance()->Show();
- aura::Desktop::GetInstance()->SetSize(gfx::Size(500, 500));
- }
- virtual ~WindowTest() {}
-
- // Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
- }
-
- virtual void TearDown() OVERRIDE {
- }
-
- Window* CreateTestWindow(SkColor color,
- int id,
- const gfx::Rect& bounds,
- Window* parent) {
- Window* window = new Window(new TestWindowDelegate(color));
- window->set_id(id);
- window->Init();
- window->SetBounds(bounds, 0);
- window->SetVisibility(Window::VISIBILITY_SHOWN);
- window->SetParent(parent);
- return window;
- }
-
- void RunPendingMessages() {
- MessageLoop main_message_loop(MessageLoop::TYPE_UI);
- MessageLoopForUI::current()->Run(NULL);
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(WindowTest);
-};
-
-} // namespace
-
-TEST_F(WindowTest, HitTest) {
- Window w1(new TestWindowDelegate(SK_ColorWHITE));
- w1.set_id(1);
- w1.Init();
- w1.SetBounds(gfx::Rect(10, 10, 50, 50), 0);
- w1.SetVisibility(Window::VISIBILITY_SHOWN);
- w1.SetParent(NULL);
-
- // Points are in the Window's coordinates.
- EXPECT_TRUE(w1.HitTest(gfx::Point(1, 1)));
- EXPECT_FALSE(w1.HitTest(gfx::Point(-1, -1)));
-
- // TODO(beng): clip Window to parent.
-}
-
-TEST_F(WindowTest, GetEventHandlerForPoint) {
- scoped_ptr<Window> w1(
- CreateTestWindow(SK_ColorWHITE, 1, gfx::Rect(10, 10, 500, 500), NULL));
- scoped_ptr<Window> w11(
- CreateTestWindow(SK_ColorGREEN, 11, gfx::Rect(5, 5, 100, 100), w1.get()));
- scoped_ptr<Window> w111(
- CreateTestWindow(SK_ColorCYAN, 111, gfx::Rect(5, 5, 75, 75), w11.get()));
- scoped_ptr<Window> w1111(
- CreateTestWindow(SK_ColorRED, 1111, gfx::Rect(5, 5, 50, 50), w111.get()));
- scoped_ptr<Window> w12(
- CreateTestWindow(SK_ColorMAGENTA, 12, gfx::Rect(10, 420, 25, 25),
- w1.get()));
- scoped_ptr<Window> w121(
- CreateTestWindow(SK_ColorYELLOW, 121, gfx::Rect(5, 5, 5, 5), w12.get()));
- scoped_ptr<Window> w13(
- CreateTestWindow(SK_ColorGRAY, 13, gfx::Rect(5, 470, 50, 50), w1.get()));
-
- Window* desktop = Desktop::GetInstance()->window();
- EXPECT_EQ(desktop, desktop->GetEventHandlerForPoint(gfx::Point(5, 5)));
- EXPECT_EQ(w1.get(), desktop->GetEventHandlerForPoint(gfx::Point(11, 11)));
- EXPECT_EQ(w11.get(), desktop->GetEventHandlerForPoint(gfx::Point(16, 16)));
- EXPECT_EQ(w111.get(), desktop->GetEventHandlerForPoint(gfx::Point(21, 21)));
- EXPECT_EQ(w1111.get(), desktop->GetEventHandlerForPoint(gfx::Point(26, 26)));
- EXPECT_EQ(w12.get(), desktop->GetEventHandlerForPoint(gfx::Point(21, 431)));
- EXPECT_EQ(w121.get(), desktop->GetEventHandlerForPoint(gfx::Point(26, 436)));
- EXPECT_EQ(w13.get(), desktop->GetEventHandlerForPoint(gfx::Point(26, 481)));
-}
-
-} // namespace internal
-} // namespace aura
-