Commit 970aa36e authored by ben@chromium.org's avatar ben@chromium.org

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
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=98850
Review URL: http://codereview.chromium.org/7791030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98866 0039d316-1c4b-4281-b951-d872f2087c98
parent c47301e8
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
'event.cc', 'event.cc',
'event.h', 'event.h',
'event_win.cc', 'event_win.cc',
'root_window.cc',
'root_window.h',
'window.cc', 'window.cc',
'window.h', 'window.h',
'window_delegate.h', 'window_delegate.h',
...@@ -58,5 +60,29 @@ ...@@ -58,5 +60,29 @@
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources.rc', '<(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',
],
},
], ],
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "aura/desktop.h" #include "aura/desktop.h"
#include "aura/event.h"
#include "aura/window.h" #include "aura/window.h"
#include "aura/window_delegate.h" #include "aura/window_delegate.h"
#include "base/at_exit.h" #include "base/at_exit.h"
...@@ -12,7 +13,6 @@ ...@@ -12,7 +13,6 @@
#include "third_party/skia/include/core/SkXfermode.h" #include "third_party/skia/include/core/SkXfermode.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_paths.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/canvas_skia.h" #include "ui/gfx/canvas_skia.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
...@@ -23,10 +23,17 @@ class DemoWindowDelegate : public aura::WindowDelegate { ...@@ -23,10 +23,17 @@ class DemoWindowDelegate : public aura::WindowDelegate {
public: public:
explicit DemoWindowDelegate(SkColor color) : color_(color) {} explicit DemoWindowDelegate(SkColor color) : color_(color) {}
virtual bool OnMouseEvent(const aura::MouseEvent& event) OVERRIDE {
return true;
}
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
canvas->AsCanvasSkia()->drawColor(color_, SkXfermode::kSrc_Mode); canvas->AsCanvasSkia()->drawColor(color_, SkXfermode::kSrc_Mode);
} }
virtual void OnWindowDestroyed() OVERRIDE {
}
private: private:
SkColor color_; SkColor color_;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "aura/desktop.h" #include "aura/desktop.h"
#include "aura/desktop_host.h" #include "aura/desktop_host.h"
#include "aura/root_window.h"
#include "aura/window.h" #include "aura/window.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/message_loop.h" #include "base/message_loop.h"
...@@ -21,27 +22,34 @@ Desktop::Desktop() ...@@ -21,27 +22,34 @@ Desktop::Desktop()
host_->GetSize()); host_->GetSize());
host_->SetDesktop(this); host_->SetDesktop(this);
DCHECK(compositor_.get()); DCHECK(compositor_.get());
window_.reset(new Window(NULL)); window_.reset(new internal::RootWindow);
} }
Desktop::~Desktop() { Desktop::~Desktop() {
} }
void Desktop::Run() { void Desktop::Show() {
host_->Show(); host_->Show();
}
void Desktop::SetSize(const gfx::Size& size) {
host_->SetSize(size);
}
void Desktop::Run() {
Show();
MessageLoop main_message_loop(MessageLoop::TYPE_UI); MessageLoop main_message_loop(MessageLoop::TYPE_UI);
MessageLoopForUI::current()->Run(host_); MessageLoopForUI::current()->Run(host_);
} }
void Desktop::Draw() { void Desktop::Draw() {
// Second pass renders the layers.
compositor_->NotifyStart(); compositor_->NotifyStart();
window_->DrawTree(); window_->DrawTree();
compositor_->NotifyEnd(); compositor_->NotifyEnd();
} }
bool Desktop::OnMouseEvent(const MouseEvent& event) { bool Desktop::OnMouseEvent(const MouseEvent& event) {
return window_->OnMouseEvent(event); return window_->HandleMouseEvent(event);
} }
// static // static
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define AURA_DESKTOP_H_ #define AURA_DESKTOP_H_
#pragma once #pragma once
#include "aura/window.h" #include "aura/root_window.h"
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "ui/gfx/native_widget_types.h" #include "ui/gfx/native_widget_types.h"
...@@ -23,7 +23,6 @@ namespace aura { ...@@ -23,7 +23,6 @@ namespace aura {
class DesktopHost; class DesktopHost;
class MouseEvent; class MouseEvent;
class Window;
// Desktop is responsible for hosting a set of windows. // Desktop is responsible for hosting a set of windows.
class Desktop { class Desktop {
...@@ -31,6 +30,12 @@ class Desktop { ...@@ -31,6 +30,12 @@ class Desktop {
Desktop(); 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. // Shows the desktop host and runs an event loop for it.
void Run(); void Run();
...@@ -50,7 +55,7 @@ class Desktop { ...@@ -50,7 +55,7 @@ class Desktop {
private: private:
scoped_refptr<ui::Compositor> compositor_; scoped_refptr<ui::Compositor> compositor_;
scoped_ptr<Window> window_; scoped_ptr<internal::RootWindow> window_;
DesktopHost* host_; DesktopHost* host_;
......
...@@ -37,8 +37,9 @@ class DesktopHost : public MessageLoop::Dispatcher { ...@@ -37,8 +37,9 @@ class DesktopHost : public MessageLoop::Dispatcher {
// Shows the DesktopHost. // Shows the DesktopHost.
virtual void Show() = 0; virtual void Show() = 0;
// Returns the size of the DesktopHost. // Gets/Sets the size of the DesktopHost.
virtual gfx::Size GetSize() = 0; virtual gfx::Size GetSize() = 0;
virtual void SetSize(const gfx::Size& size) = 0;
}; };
} // namespace aura } // namespace aura
......
...@@ -47,6 +47,17 @@ gfx::Size DesktopHostWin::GetSize() { ...@@ -47,6 +47,17 @@ gfx::Size DesktopHostWin::GetSize() {
return gfx::Rect(r).size(); 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() { void DesktopHostWin::OnClose() {
// TODO: this obviously shouldn't be here. // TODO: this obviously shouldn't be here.
MessageLoopForUI::current()->Quit(); MessageLoopForUI::current()->Quit();
......
...@@ -25,6 +25,7 @@ class DesktopHostWin : public DesktopHost, public ui::WindowImpl { ...@@ -25,6 +25,7 @@ class DesktopHostWin : public DesktopHost, public ui::WindowImpl {
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
virtual void Show() OVERRIDE; virtual void Show() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE; virtual gfx::Size GetSize() OVERRIDE;
virtual void SetSize(const gfx::Size& size) OVERRIDE;
private: private:
BEGIN_MSG_MAP_EX(DesktopHostWin) BEGIN_MSG_MAP_EX(DesktopHostWin)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "aura/event.h" #include "aura/event.h"
#include "aura/window.h"
namespace aura { namespace aura {
Event::Event(ui::EventType type, int flags) Event::Event(ui::EventType type, int flags)
...@@ -27,5 +29,18 @@ Event::Event(const Event& copy) ...@@ -27,5 +29,18 @@ Event::Event(const Event& copy)
flags_(copy.flags_) { 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 } // namespace aura
...@@ -21,6 +21,8 @@ typedef union _XEvent XEvent; ...@@ -21,6 +21,8 @@ typedef union _XEvent XEvent;
typedef XEvent* NativeEvent; typedef XEvent* NativeEvent;
#endif #endif
class Window;
class Event { class Event {
public: public:
const NativeEvent& native_event() const { return native_event_; } const NativeEvent& native_event() const { return native_event_; }
...@@ -55,6 +57,11 @@ class LocatedEvent : public Event { ...@@ -55,6 +57,11 @@ class LocatedEvent : public Event {
protected: protected:
explicit LocatedEvent(NativeEvent native_event); 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_; gfx::Point location_;
private: private:
...@@ -65,6 +72,11 @@ class MouseEvent : public LocatedEvent { ...@@ -65,6 +72,11 @@ class MouseEvent : public LocatedEvent {
public: public:
explicit MouseEvent(NativeEvent native_event); 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: private:
DISALLOW_COPY_AND_ASSIGN(MouseEvent); DISALLOW_COPY_AND_ASSIGN(MouseEvent);
}; };
......
// 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
// 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_
// 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();
}
// 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();
}
// 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_
...@@ -24,6 +24,10 @@ Window::Window(WindowDelegate* delegate) ...@@ -24,6 +24,10 @@ Window::Window(WindowDelegate* delegate)
} }
Window::~Window() { Window::~Window() {
if (delegate_)
delegate_->OnWindowDestroyed();
if (parent_)
parent_->RemoveChild(this);
} }
void Window::Init() { void Window::Init() {
...@@ -70,7 +74,6 @@ void Window::DrawTree() { ...@@ -70,7 +74,6 @@ void Window::DrawTree() {
UpdateLayerCanvas(); UpdateLayerCanvas();
Draw(); Draw();
// First pass updates the layer bitmaps.
for (Windows::iterator i = children_.begin(); i != children_.end(); ++i) for (Windows::iterator i = children_.begin(); i != children_.end(); ++i)
(*i)->DrawTree(); (*i)->DrawTree();
} }
...@@ -91,10 +94,37 @@ void Window::RemoveChild(Window* child) { ...@@ -91,10 +94,37 @@ void Window::RemoveChild(Window* child) {
children_.erase(i); 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) { bool Window::OnMouseEvent(const MouseEvent& event) {
return true; 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() { void Window::UpdateLayerCanvas() {
if (needs_paint_all_) { if (needs_paint_all_) {
needs_paint_all_ = false; needs_paint_all_ = false;
......
...@@ -27,6 +27,7 @@ class WindowDelegate; ...@@ -27,6 +27,7 @@ class WindowDelegate;
// Aura window implementation. Interesting events are sent to the // Aura window implementation. Interesting events are sent to the
// WindowDelegate. // WindowDelegate.
// TODO(beng): resolve ownership.
class Window { class Window {
public: public:
enum Visibility { enum Visibility {
...@@ -80,9 +81,26 @@ class Window { ...@@ -80,9 +81,26 @@ class Window {
void AddChild(Window* child); void AddChild(Window* child);
void RemoveChild(Window* child); void RemoveChild(Window* child);
static void ConvertPointToWindow(Window* source,
Window* target,
gfx::Point* point);
// Handles a mouse event. Returns true if handled. // Handles a mouse event. Returns true if handled.
bool OnMouseEvent(const MouseEvent& event); 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: private:
typedef std::vector<Window*> Windows; typedef std::vector<Window*> Windows;
......
...@@ -12,11 +12,19 @@ class Canvas; ...@@ -12,11 +12,19 @@ class Canvas;
namespace aura { namespace aura {
class MouseEvent;
// Delegate interface for aura::Window. // Delegate interface for aura::Window.
class WindowDelegate { class WindowDelegate {
public: public:
virtual bool OnMouseEvent(const MouseEvent& event) = 0;
// Asks the delegate to paint window contents into the supplied canvas. // Asks the delegate to paint window contents into the supplied canvas.
virtual void OnPaint(gfx::Canvas* canvas) = 0; 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;
protected: protected:
virtual ~WindowDelegate() {} virtual ~WindowDelegate() {}
......
// 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment