| Index: chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| index 3d8879db2991d78f3fe03e423e8004debb1a0b32..571e92067bdebeace48334d6beef727918e64d55 100644
|
| --- a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| +++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
|
| @@ -5,13 +5,14 @@
|
| #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h"
|
|
|
| #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
|
| -#include "ui/aura/test/aura_test_base.h"
|
| #include "ui/aura/window.h"
|
| -#include "ui/aura/window_event_dispatcher.h"
|
| +#include "ui/aura/window_tree_host.h"
|
| +#include "ui/events/event_processor.h"
|
| #include "ui/views/controls/webview/webview.h"
|
| +#include "ui/views/test/views_test_base.h"
|
| #include "ui/wm/core/easy_resize_window_targeter.h"
|
|
|
| -class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase {
|
| +class ShapedAppWindowTargeterTest : public views::ViewsTestBase {
|
| public:
|
| ShapedAppWindowTargeterTest()
|
| : web_view_(NULL) {
|
| @@ -26,12 +27,12 @@ class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase {
|
|
|
| protected:
|
| virtual void SetUp() OVERRIDE {
|
| - aura::test::AuraTestBase::SetUp();
|
| + views::ViewsTestBase::SetUp();
|
| widget_.reset(new views::Widget);
|
| views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
|
| params.remove_standard_frame = true;
|
| params.bounds = gfx::Rect(30, 30, 100, 100);
|
| - params.context = root_window();
|
| + params.context = host()->window();
|
| params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
|
| widget_->Init(params);
|
|
|
| @@ -43,7 +44,7 @@ class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase {
|
|
|
| virtual void TearDown() OVERRIDE {
|
| widget_.reset();
|
| - aura::test::AuraTestBase::TearDown();
|
| + views::ViewsTestBase::TearDown();
|
| }
|
|
|
| private:
|
| @@ -81,7 +82,7 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) {
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| - EXPECT_EQ(root_window(), move.target());
|
| + EXPECT_EQ(host()->window(), move.target());
|
|
|
| // But events within the shape will still reach the window.
|
| ui::MouseEvent move2(ui::ET_MOUSE_MOVED,
|
| @@ -98,8 +99,8 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
|
| // receive events outside of its bounds. Verify that this window-targeter is
|
| // active unless the window has a custom shape.
|
| gfx::Insets inset(-30, -30, -30, -30);
|
| - root_window()->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
|
| - new wm::EasyResizeWindowTargeter(root_window(), inset, inset)));
|
| + host()->window()->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
|
| + new wm::EasyResizeWindowTargeter(host()->window(), inset, inset)));
|
|
|
| aura::Window* window = widget()->GetNativeWindow();
|
| {
|
| @@ -139,7 +140,7 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| - EXPECT_EQ(root_window(), move.target());
|
| + EXPECT_EQ(host()->window(), move.target());
|
| }
|
|
|
| // Remove the custom shape. This should restore the behaviour of targeting the
|
| @@ -201,13 +202,13 @@ TEST_F(ShapedAppWindowTargeterTest, ResizeInsetsWithinBounds) {
|
| {
|
| // With an EasyResizeTargeter on the container, an event
|
| // inside the window and within 5px of an edge should have
|
| - // root_window() as its target.
|
| + // host()->window() as its target.
|
| ui::MouseEvent move(ui::ET_MOUSE_MOVED,
|
| gfx::Point(32, 37), gfx::Point(32, 37),
|
| ui::EF_NONE, ui::EF_NONE);
|
| ui::EventDispatchDetails details =
|
| event_processor()->OnEventFromSource(&move);
|
| ASSERT_FALSE(details.dispatcher_destroyed);
|
| - EXPECT_EQ(root_window(), move.target());
|
| + EXPECT_EQ(host()->window(), move.target());
|
| }
|
| }
|
|
|