| Index: ui/aura/shared/compound_event_filter_unittest.cc
|
| diff --git a/ui/aura/shared/compound_event_filter_unittest.cc b/ui/aura/shared/compound_event_filter_unittest.cc
|
| index 85ecc47db4ebe892e3b41c05a44a5f9ccb6260cf..e8915a29d00eea2b4caa19849290318505c3c4a7 100644
|
| --- a/ui/aura/shared/compound_event_filter_unittest.cc
|
| +++ b/ui/aura/shared/compound_event_filter_unittest.cc
|
| @@ -5,7 +5,7 @@
|
| #include "ui/aura/shared/compound_event_filter.h"
|
|
|
| #include "ui/aura/client/activation_client.h"
|
| -#include "ui/aura/cursor_manager.h"
|
| +#include "ui/aura/client/cursor_client.h"
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/root_window.h"
|
| #include "ui/aura/shared/root_window_capture_client.h"
|
| @@ -17,6 +17,27 @@ namespace {
|
| base::TimeDelta GetTime() {
|
| return base::Time::NowFromSystemTime() - base::Time();
|
| }
|
| +
|
| +class TestVisibleClient : public aura::client::CursorClient {
|
| + public:
|
| + TestVisibleClient() : visible_(false) {}
|
| + virtual ~TestVisibleClient() {}
|
| +
|
| + virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE {
|
| + }
|
| +
|
| + virtual void ShowCursor(bool show) OVERRIDE {
|
| + visible_ = show;
|
| + }
|
| +
|
| + virtual bool GetVisible() const OVERRIDE {
|
| + return visible_;
|
| + }
|
| +
|
| + private:
|
| + bool visible_;
|
| +};
|
| +
|
| }
|
|
|
| namespace aura {
|
| @@ -35,30 +56,32 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
|
| gfx::Rect(5, 5, 100, 100), NULL));
|
| window->Show();
|
| window->SetCapture();
|
| - CursorManager* cursor_manager = aura::Env::GetInstance()->cursor_manager();
|
| +
|
| + TestVisibleClient cursor_client;
|
| + aura::client::SetCursorClient(root_window(), &cursor_client);
|
|
|
| MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
|
| gfx::Point(15, 15), 0);
|
| root_window()->DispatchMouseEvent(&mouse);
|
| - EXPECT_TRUE(cursor_manager->cursor_visible());
|
| + EXPECT_TRUE(cursor_client.GetVisible());
|
|
|
| // This press is required for the GestureRecognizer to associate a target
|
| // with kTouchId
|
| TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(90, 90), 1, GetTime());
|
| root_window()->DispatchTouchEvent(&press);
|
| - EXPECT_FALSE(cursor_manager->cursor_visible());
|
| + EXPECT_FALSE(cursor_client.GetVisible());
|
|
|
| TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 1,
|
| GetTime());
|
| root_window()->DispatchTouchEvent(&move);
|
| - EXPECT_FALSE(cursor_manager->cursor_visible());
|
| + EXPECT_FALSE(cursor_client.GetVisible());
|
|
|
| TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), 1, GetTime());
|
| root_window()->DispatchTouchEvent(&release);
|
| - EXPECT_FALSE(cursor_manager->cursor_visible());
|
| + EXPECT_FALSE(cursor_client.GetVisible());
|
|
|
| root_window()->DispatchMouseEvent(&mouse);
|
| - EXPECT_TRUE(cursor_manager->cursor_visible());
|
| + EXPECT_TRUE(cursor_client.GetVisible());
|
| }
|
|
|
| } // namespace test
|
|
|