Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Unified Diff: ui/aura/shared/compound_event_filter_unittest.cc

Issue 10692170: Aura desktop: Show resize cursors again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/shared/compound_event_filter.cc ('k') | ui/views/widget/desktop_native_widget_helper_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..edf6fb12e7ad41c6ddc6db349f9b747358448264 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 IsCursorVisible() 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.IsCursorVisible());
// 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.IsCursorVisible());
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.IsCursorVisible());
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.IsCursorVisible());
root_window()->DispatchMouseEvent(&mouse);
- EXPECT_TRUE(cursor_manager->cursor_visible());
+ EXPECT_TRUE(cursor_client.IsCursorVisible());
}
} // namespace test
« no previous file with comments | « ui/aura/shared/compound_event_filter.cc ('k') | ui/views/widget/desktop_native_widget_helper_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698