Commit 791b87be authored by dnicoara@chromium.org's avatar dnicoara@chromium.org

[Ozone-Test] Add proper cursor factory implementation

Fixes some of the Ash unittests dealing with cursors.

BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/384753003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282368 0039d316-1c4b-4281-b951-d872f2087c98
parent 2dd5bd88
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "ui/ozone/ozone_platform.h" #include "ui/ozone/ozone_platform.h"
#include "ui/ozone/ozone_switches.h" #include "ui/ozone/ozone_switches.h"
#include "ui/ozone/platform/test/file_surface_factory.h" #include "ui/ozone/platform/test/file_surface_factory.h"
#include "ui/ozone/public/cursor_factory_ozone.h" #include "ui/ozone/platform/test/test_cursor_factory.h"
#include "ui/ozone/public/gpu_platform_support.h" #include "ui/ozone/public/gpu_platform_support.h"
#include "ui/ozone/public/gpu_platform_support_host.h" #include "ui/ozone/public/gpu_platform_support_host.h"
...@@ -66,7 +66,7 @@ class OzonePlatformTest : public OzonePlatform { ...@@ -66,7 +66,7 @@ class OzonePlatformTest : public OzonePlatform {
surface_factory_ozone_.reset(new FileSurfaceFactory(file_path_)); surface_factory_ozone_.reset(new FileSurfaceFactory(file_path_));
event_factory_ozone_.reset( event_factory_ozone_.reset(
new EventFactoryEvdev(NULL, device_manager_.get())); new EventFactoryEvdev(NULL, device_manager_.get()));
cursor_factory_ozone_.reset(new CursorFactoryOzone()); cursor_factory_ozone_.reset(new TestCursorFactory());
gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
} }
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
'file_surface_factory.h', 'file_surface_factory.h',
'ozone_platform_test.cc', 'ozone_platform_test.cc',
'ozone_platform_test.h', 'ozone_platform_test.h',
'test_cursor_factory.cc',
'test_cursor_factory.h',
], ],
}, },
], ],
......
// Copyright 2014 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 "ui/ozone/platform/test/test_cursor_factory.h"
namespace ui {
TestCursorFactory::TestCursorFactory()
: cursor_window_(gfx::kNullAcceleratedWidget) {}
TestCursorFactory::~TestCursorFactory() {}
gfx::AcceleratedWidget TestCursorFactory::GetCursorWindow() {
return cursor_window_;
}
void TestCursorFactory::SetBitmapCursor(
gfx::AcceleratedWidget widget,
scoped_refptr<BitmapCursorOzone> cursor) {
cursor_window_ = widget;
cursor_ = cursor;
}
} // namespace ui
// Copyright 2014 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 UI_OZONE_PLATFORM_TEST_TEST_CURSOR_FACTORY_H_
#define UI_OZONE_PLATFORM_TEST_TEST_CURSOR_FACTORY_H_
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
namespace ui {
class TestCursorFactory : public BitmapCursorFactoryOzone {
public:
TestCursorFactory();
virtual ~TestCursorFactory();
// BitmapCursorFactoryOzone:
virtual gfx::AcceleratedWidget GetCursorWindow() OVERRIDE;
virtual void SetBitmapCursor(
gfx::AcceleratedWidget widget,
scoped_refptr<BitmapCursorOzone> cursor) OVERRIDE;
private:
gfx::AcceleratedWidget cursor_window_;
scoped_refptr<BitmapCursorOzone> cursor_;
DISALLOW_COPY_AND_ASSIGN(TestCursorFactory);
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_TEST_TEST_CURSOR_FACTORY_H_
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