#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/test/aura_test_base.h"
-#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/hit_test.h"
#include "ui/events/event.h"
+#include "ui/events/test/event_generator.h"
#include "ui/gfx/screen.h"
#include "ui/wm/core/window_util.h"
#include "ui/wm/public/window_move_client.h"
}
void DragFromCenterBy(aura::Window* window, int dx, int dy) {
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window);
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window);
generator.DragMouseBy(dx, dy);
}
void TouchDragFromCenterBy(aura::Window* window, int dx, int dy) {
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window);
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), window);
generator.PressMoveAndReleaseTouchBy(dx, dy);
}
window_delegate->set_minimum_size(gfx::Size(40, 40));
gfx::Point position = w1->bounds().origin();
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow());
generator.MoveMouseToCenterOf(w1.get());
generator.DragMouseBy(100, 100);
// Position should not have changed.
// Verifies we don't let windows drag to a -y location.
TEST_F(ToplevelWindowEventHandlerTest, DontDragToNegativeY) {
scoped_ptr<aura::Window> target(CreateWindow(HTTOP));
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
generator.MoveMouseTo(0, 5);
generator.DragMouseBy(0, -5);
// The y location and height should not have changed.
0,
gfx::Rect(0, 0, 100, 100)));
wm::WindowState* window_state = wm::GetWindowState(target.get());
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
gfx::Rect old_bounds = target->bounds();
gfx::Point location(5, 5);
target->SetProperty(aura::client::kCanMaximizeKey, true);
RootWindowController::ForWindow(target.get())
->GetContainer(kShellWindowId_LockSystemModalContainer);
lock->AddChild(target.get());
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
gfx::Rect old_bounds = target->bounds();
gfx::Point location(5, 5);
target->SetProperty(aura::client::kCanMaximizeKey, true);
wm::WindowState* window_state = wm::GetWindowState(window.get());
window_state->Activate();
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- window.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ window.get());
gfx::Rect old_bounds = window->bounds();
gfx::Point location, end;
end = location = window->GetBoundsInRootWindow().CenterPoint();
scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION));
wm::WindowState* window_state = wm::GetWindowState(target.get());
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
gfx::Rect old_bounds = target->bounds();
gfx::Point location(5, 5);
new TestWindowDelegate(HTCAPTION),
1, gfx::Rect(100, 0, 100, 100)));
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
gfx::Rect old_bounds = target->bounds();
gfx::Point location(5, 5);
target->SetProperty(aura::client::kCanMaximizeKey, true);
// Try to drag |notmoved| window. This should not move the window.
{
gfx::Rect bounds = notmoved->bounds();
- aura::test::EventGenerator gen(Shell::GetPrimaryRootWindow(),
- notmoved.get());
+ ui::test::EventGenerator gen(Shell::GetPrimaryRootWindow(), notmoved.get());
gfx::Point start = notmoved->bounds().origin() + gfx::Vector2d(10, 10);
gfx::Point end = start + gfx::Vector2d(100, 10);
gen.GestureScrollSequence(start, end,
#endif
TEST_F(ToplevelWindowEventHandlerTest, MAYBE_EscapeReverts) {
scoped_ptr<aura::Window> target(CreateWindow(HTBOTTOMRIGHT));
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
generator.PressLeftButton();
generator.MoveMouseBy(10, 11);
{
scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION));
target->Focus();
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
generator.PressLeftButton();
generator.MoveMouseBy(10, 11);
RunAllPendingInMessageLoop();
{
scoped_ptr<aura::Window> target(CreateWindow(HTCAPTION));
target->Focus();
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- target.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ target.get());
generator.PressLeftButton();
generator.MoveMouseBy(10, 11);
RunAllPendingInMessageLoop();
EXPECT_EQ("0,0 100x100", window1->bounds().ToString());
scoped_ptr<aura::Window> window2(CreateWindow(HTCAPTION));
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- window1.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ window1.get());
window1->Focus();
generator.PressLeftButton();
generator.MoveMouseBy(10, 11);
namespace {
-void SendMouseReleaseAndReleaseCapture(aura::test::EventGenerator* generator,
+void SendMouseReleaseAndReleaseCapture(ui::test::EventGenerator* generator,
aura::Window* window) {
generator->ReleaseLeftButton();
window->ReleaseCapture();
// immediately after the mouse release. views::Widget has this behavior.
TEST_F(ToplevelWindowEventHandlerTest, CaptureLossAfterMouseRelease) {
scoped_ptr<aura::Window> window(CreateWindow(HTNOWHERE));
- aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
- window.get());
+ ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
+ window.get());
generator.PressLeftButton();
window->SetCapture();