summaryrefslogtreecommitdiffstats
path: root/ui/views
diff options
context:
space:
mode:
authortdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-01 03:50:40 +0000
committertdanderson@chromium.org <tdanderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-01 03:50:40 +0000
commit5ad9f4066145a3517f13031d8a4a7ec3bd81d3dd (patch)
tree0c41f3d4a71b366f39b2241319d49a303f6c5752 /ui/views
parentb238bc6fa1af73678f3732778150b6f34c165eaa (diff)
downloadchromium_src-5ad9f4066145a3517f13031d8a4a7ec3bd81d3dd.zip
chromium_src-5ad9f4066145a3517f13031d8a4a7ec3bd81d3dd.tar.gz
chromium_src-5ad9f4066145a3517f13031d8a4a7ec3bd81d3dd.tar.bz2
Add test coverage for InputMsg_CursorVisibilityChange
The CL https://codereview.chromium.org/14047015/ introduced a new IPC message type used to notify the renderer when the mouse cursor visibility changes. This CL adds test coverage and also does some refactoring by creating the files test_cursor_client.{h,cc}. BUG=153784 Review URL: https://chromiumcodereview.appspot.com/15423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203551 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r--ui/views/corewm/compound_event_filter_unittest.cc65
1 files changed, 3 insertions, 62 deletions
diff --git a/ui/views/corewm/compound_event_filter_unittest.cc b/ui/views/corewm/compound_event_filter_unittest.cc
index eae159d..56159f0 100644
--- a/ui/views/corewm/compound_event_filter_unittest.cc
+++ b/ui/views/corewm/compound_event_filter_unittest.cc
@@ -11,6 +11,7 @@
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_activation_client.h"
+#include "ui/aura/test/test_cursor_client.h"
#include "ui/aura/test/test_windows.h"
#include "ui/base/events/event.h"
#include "ui/base/events/event_utils.h"
@@ -21,66 +22,6 @@ base::TimeDelta GetTime() {
return ui::EventTimeForNow();
}
-class TestCursorClient : public aura::client::CursorClient {
- public:
- TestCursorClient() : visible_(true), mouse_events_enabled_(true) {}
- virtual ~TestCursorClient() {}
-
- virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE {
- }
-
- virtual void ShowCursor() OVERRIDE {
- visible_ = true;
- }
-
- virtual void HideCursor() OVERRIDE {
- visible_ = false;
- }
-
- virtual bool IsCursorVisible() const OVERRIDE {
- return visible_;
- }
-
- virtual void EnableMouseEvents() OVERRIDE {
- mouse_events_enabled_ = true;
- }
-
- virtual void DisableMouseEvents() OVERRIDE {
- mouse_events_enabled_ = false;
- }
-
- virtual bool IsMouseEventsEnabled() const OVERRIDE {
- return mouse_events_enabled_;
- }
-
- virtual void SetScale(float scale) OVERRIDE {
- }
-
- virtual void SetDisplay(const gfx::Display& display) OVERRIDE {
- }
-
- virtual void LockCursor() OVERRIDE {
- }
-
- virtual void UnlockCursor() OVERRIDE {
- }
-
- virtual void SetCursorResourceModule(const string16& module_name) OVERRIDE {
- }
-
- virtual void AddObserver(
- aura::client::CursorClientObserver* observer) OVERRIDE {
- }
-
- virtual void RemoveObserver(
- aura::client::CursorClientObserver* observer) OVERRIDE {
- }
-
- private:
- bool visible_;
- bool mouse_events_enabled_;
-};
-
}
namespace views {
@@ -116,7 +57,7 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
window->Show();
window->SetCapture();
- TestCursorClient cursor_client;
+ aura::test::TestCursorClient cursor_client;
aura::client::SetCursorClient(root_window(), &cursor_client);
ui::MouseEvent mouse0(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
@@ -194,7 +135,7 @@ TEST_F(CompoundEventFilterTest, DontHideWhenMouseDown) {
gfx::Rect(5, 5, 100, 100), root_window()));
window->Show();
- TestCursorClient cursor_client;
+ aura::test::TestCursorClient cursor_client;
aura::client::SetCursorClient(root_window(), &cursor_client);
// Move and press the mouse over the window.