#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/aura/root_window.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
namespace ash {
namespace test {
public:
virtual void SetUp() OVERRIDE {
AshTestBase::SetUp();
- UpdateDisplay("200x200,300x300");
}
aura::Window* CreateTestWindow(const gfx::Rect& bounds) {
}
static aura::Window* GetTarget(const gfx::Point& location) {
- scoped_ptr<internal::DragDropTracker> tracker(
- new internal::DragDropTracker(Shell::GetPrimaryRootWindow(),
- NULL));
+ scoped_ptr<DragDropTracker> tracker(
+ new DragDropTracker(Shell::GetPrimaryRootWindow(), NULL));
ui::MouseEvent e(ui::ET_MOUSE_DRAGGED,
location,
location,
+ ui::EF_NONE,
ui::EF_NONE);
aura::Window* target = tracker->GetTarget(e);
return target;
static ui::LocatedEvent* ConvertEvent(aura::Window* target,
const ui::MouseEvent& event) {
- scoped_ptr<internal::DragDropTracker> tracker(
- new internal::DragDropTracker(Shell::GetPrimaryRootWindow(),
- NULL));
+ scoped_ptr<DragDropTracker> tracker(
+ new DragDropTracker(Shell::GetPrimaryRootWindow(), NULL));
ui::LocatedEvent* converted = tracker->ConvertEvent(target, event);
return converted;
}
};
-// TODO(mazda): Remove this once ash/wm/coordinate_conversion.h supports
-// non-X11 platforms.
-#if defined(USE_X11)
-#define MAYBE_GetTarget GetTarget
-#else
-#define MAYBE_GetTarget DISABLED_GetTarget
-#endif
+TEST_F(DragDropTrackerTest, GetTarget) {
+ if (!SupportsMultipleDisplays())
+ return;
-TEST_F(DragDropTrackerTest, MAYBE_GetTarget) {
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ UpdateDisplay("200x200,300x300");
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(2U, root_windows.size());
scoped_ptr<aura::Window> window0(
EXPECT_NE(window1.get(), GetTarget(gfx::Point(50, 50)));
}
-// TODO(mazda): Remove this once ash/wm/coordinate_conversion.h supports
-// non-X11 platforms.
-#if defined(USE_X11)
-#define MAYBE_ConvertEvent ConvertEvent
-#else
-#define MAYBE_ConvertEvent DISABLED_ConvertEvent
-#endif
+TEST_F(DragDropTrackerTest, ConvertEvent) {
+ if (!SupportsMultipleDisplays())
+ return;
-TEST_F(DragDropTrackerTest, MAYBE_ConvertEvent) {
- Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ UpdateDisplay("200x200,300x300");
+ aura::Window::Windows root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(2U, root_windows.size());
scoped_ptr<aura::Window> window0(
ui::MouseEvent original00(ui::ET_MOUSE_DRAGGED,
gfx::Point(50, 50),
gfx::Point(50, 50),
+ ui::EF_NONE,
ui::EF_NONE);
scoped_ptr<ui::LocatedEvent> converted00(ConvertEvent(window0.get(),
original00));
ui::MouseEvent original01(ui::ET_MOUSE_DRAGGED,
gfx::Point(350, 150),
gfx::Point(350, 150),
+ ui::EF_NONE,
ui::EF_NONE);
scoped_ptr<ui::LocatedEvent> converted01(ConvertEvent(window1.get(),
original01));
ui::MouseEvent original10(ui::ET_MOUSE_DRAGGED,
gfx::Point(-150, 50),
gfx::Point(-150, 50),
+ ui::EF_NONE,
ui::EF_NONE);
scoped_ptr<ui::LocatedEvent> converted10(ConvertEvent(window0.get(),
original10));
ui::MouseEvent original11(ui::ET_MOUSE_DRAGGED,
gfx::Point(150, 150),
gfx::Point(150, 150),
+ ui::EF_NONE,
ui::EF_NONE);
scoped_ptr<ui::LocatedEvent> converted11(ConvertEvent(window1.get(),
original11));