summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authormarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 13:18:41 +0000
committermarkusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 13:18:41 +0000
commitdd131d3723dee3050b746319e437514d8fdb6bb1 (patch)
treec44435187d6d4df51dcf5e02b31be151de270390 /ui
parent2c6e3b04ca361d052f1e8fdc70983bcc7c379dba (diff)
downloadchromium_src-dd131d3723dee3050b746319e437514d8fdb6bb1.zip
chromium_src-dd131d3723dee3050b746319e437514d8fdb6bb1.tar.gz
chromium_src-dd131d3723dee3050b746319e437514d8fdb6bb1.tar.bz2
Revert 285209 "Cleanups for aura/test/event_generator.h (resolve..."
> Cleanups for aura/test/event_generator.h (resolve TODOs) > > Some purely mechanical changes left over from r283694, now that > aura::test::EventGenerator has moved to ui::test in src/ui/events. > > Moves aura/test/event_generator.* to event_generator_delegate_aura.* > Removes `using ui::test::EventGenerator;` declaration and redirects > includes that don't extend the delegate to include the ui/test > event_generator.h directly > > BUG=378134 > > Review URL: https://codereview.chromium.org/406413004 TBR=tapted@chromium.org Review URL: https://codereview.chromium.org/413983006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/BUILD.gn4
-rw-r--r--ui/aura/aura.gyp4
-rw-r--r--ui/aura/gestures/gesture_recognizer_unittest.cc10
-rw-r--r--ui/aura/test/event_generator.cc (renamed from ui/aura/test/event_generator_delegate_aura.cc)4
-rw-r--r--ui/aura/test/event_generator.h (renamed from ui/aura/test/event_generator_delegate_aura.h)14
-rw-r--r--ui/aura/window_event_dispatcher_unittest.cc32
-rw-r--r--ui/aura/window_unittest.cc24
-rw-r--r--ui/chromeos/touch_exploration_controller_unittest.cc6
-rw-r--r--ui/keyboard/keyboard_controller_unittest.cc4
-rw-r--r--ui/views/corewm/capture_controller_unittest.cc4
-rw-r--r--ui/views/corewm/desktop_capture_controller_unittest.cc4
-rw-r--r--ui/views/corewm/tooltip_controller_unittest.cc14
-rw-r--r--ui/views/touchui/touch_selection_controller_impl_unittest.cc8
-rw-r--r--ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc2
-rw-r--r--ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc8
-rw-r--r--ui/views/widget/widget_interactive_uitest.cc4
-rw-r--r--ui/wm/core/compound_event_filter_unittest.cc6
-rw-r--r--ui/wm/core/focus_controller_unittest.cc18
-rw-r--r--ui/wm/core/input_method_event_filter_unittest.cc6
19 files changed, 91 insertions, 85 deletions
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 6395c56..c3a6942 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -150,8 +150,8 @@ source_set("test_support") {
"test/aura_test_utils.cc",
"test/aura_test_utils.h",
"test/env_test_helper.h",
- "test/event_generator_delegate_aura.cc",
- "test/event_generator_delegate_aura.h",
+ "test/event_generator.cc",
+ "test/event_generator.h",
"test/test_cursor_client.cc",
"test/test_cursor_client.h",
"test/test_focus_client.cc",
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp
index 84e5477..6a5788f 100644
--- a/ui/aura/aura.gyp
+++ b/ui/aura/aura.gyp
@@ -168,8 +168,8 @@
'test/aura_test_utils.cc',
'test/aura_test_utils.h',
'test/env_test_helper.h',
- 'test/event_generator_delegate_aura.cc',
- 'test/event_generator_delegate_aura.h',
+ 'test/event_generator.cc',
+ 'test/event_generator.h',
'test/test_cursor_client.cc',
'test/test_cursor_client.h',
'test/test_focus_client.cc',
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index ad99093..872fded 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -10,6 +10,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/env.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/test/test_windows.h"
#include "ui/aura/window.h"
@@ -23,7 +24,6 @@
#include "ui/events/gestures/gesture_recognizer_impl.h"
#include "ui/events/gestures/gesture_sequence.h"
#include "ui/events/gestures/gesture_types.h"
-#include "ui/events/test/event_generator.h"
#include "ui/events/test/events_test_utils.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -2472,7 +2472,7 @@ TEST_P(GestureRecognizerTest, GestureEndLocation) {
GestureEventConsumeDelegate delegate;
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
&delegate, -1234, gfx::Rect(10, 10, 300, 300), root_window()));
- ui::test::EventGenerator generator(root_window(), window.get());
+ EventGenerator generator(root_window(), window.get());
const gfx::Point begin(20, 20);
const gfx::Point end(150, 150);
const gfx::Vector2d window_offset =
@@ -2495,7 +2495,7 @@ TEST_P(GestureRecognizerTest, CaptureSendsGestureEnd) {
scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
delegate.get(), -1234, gfx::Rect(10, 10, 300, 300), root_window()));
- ui::test::EventGenerator generator(root_window());
+ EventGenerator generator(root_window());
generator.MoveMouseRelativeTo(window.get(), gfx::Point(10, 10));
generator.PressTouch();
@@ -2526,7 +2526,7 @@ TEST_P(GestureRecognizerTest, CaptureDoesNotCancelFinishedTouches) {
-1234, gfx::Rect(10, 10, 300, 300), root_window()));
window1->SetCapture();
- ui::test::EventGenerator generator(root_window());
+ EventGenerator generator(root_window());
TimedEvents tes;
// Generate two touch-press events on the window.
@@ -2865,7 +2865,7 @@ TEST_P(GestureRecognizerTest, MultiFingerSwipe) {
gfx::Point(80, 50)
};
- ui::test::EventGenerator generator(root_window(), window.get());
+ aura::test::EventGenerator generator(root_window(), window.get());
// The unified gesture recognizer assumes a finger has stopped if it hasn't
// moved for too long. See ui/events/gesture_detection/velocity_tracker.cc's
diff --git a/ui/aura/test/event_generator_delegate_aura.cc b/ui/aura/test/event_generator.cc
index a32ab5b..e899afd 100644
--- a/ui/aura/test/event_generator_delegate_aura.cc
+++ b/ui/aura/test/event_generator.cc
@@ -1,8 +1,8 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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/aura/test/event_generator_delegate_aura.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/window_event_dispatcher.h"
diff --git a/ui/aura/test/event_generator_delegate_aura.h b/ui/aura/test/event_generator.h
index 5850789..aed36d6 100644
--- a/ui/aura/test/event_generator_delegate_aura.h
+++ b/ui/aura/test/event_generator.h
@@ -1,9 +1,11 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_
-#define UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_
+// TODO(tapted): Rename this file event_generator_delegate_aura.h.
+
+#ifndef UI_AURA_TEST_EVENT_GENERATOR_H_
+#define UI_AURA_TEST_EVENT_GENERATOR_H_
#include "ui/events/test/event_generator.h"
@@ -49,7 +51,11 @@ class EventGeneratorDelegateAura : public ui::test::EventGeneratorDelegate {
DISALLOW_COPY_AND_ASSIGN(EventGeneratorDelegateAura);
};
+// Expose the EventGenerator from ui::test in the aura::test namespace.
+// TODO(tapted): Remove this.
+using ui::test::EventGenerator;
+
} // namespace test
} // namespace aura
-#endif // UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_
+#endif // UI_AURA_TEST_EVENT_GENERATOR_H_
diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
index 13403e7..55b7eaa 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -15,6 +15,7 @@
#include "ui/aura/env.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/env_test_helper.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_cursor_client.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/test/test_window_delegate.h"
@@ -27,7 +28,6 @@
#include "ui/events/event_utils.h"
#include "ui/events/gestures/gesture_configuration.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#include "ui/events/test/event_generator.h"
#include "ui/events/test/test_event_handler.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -318,7 +318,7 @@ TEST_F(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) {
{
// Attempting to send a key event to w1 (not in the lock container) should
// cause focus to be reset.
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.PressKey(ui::VKEY_SPACE, 0);
EXPECT_EQ(NULL, client::GetFocusClient(w1)->GetFocusedWindow());
EXPECT_FALSE(IsFocusedWindow(w1));
@@ -327,12 +327,12 @@ TEST_F(WindowEventDispatcherTest, CanProcessEventsWithinSubtree) {
{
// Events sent to a window not in the lock container will not be processed.
// i.e. never sent to the non-lock container's event filter.
- ui::test::EventGenerator generator(root_window(), w1);
+ test::EventGenerator generator(root_window(), w1);
generator.ClickLeftButton();
EXPECT_EQ(0, nonlock_ef.num_mouse_events());
// Events sent to a window in the lock container will be processed.
- ui::test::EventGenerator generator3(root_window(), w3.get());
+ test::EventGenerator generator3(root_window(), w3.get());
generator3.PressLeftButton();
EXPECT_EQ(1, lock_ef.num_mouse_events());
}
@@ -826,7 +826,7 @@ TEST_F(WindowEventDispatcherTest, TouchMovesHeldOnScroll) {
&delegate, 1, gfx::Rect(50, 50, 100, 100), root_window()));
window->AddPreTargetHandler(&handler);
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.GestureScrollSequence(
gfx::Point(60, 60), gfx::Point(10, 60),
base::TimeDelta::FromMilliseconds(100), 25);
@@ -1163,7 +1163,7 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringDispatch) {
w1->AddPreTargetHandler(&w1_filter);
client::GetFocusClient(w1.get())->FocusWindow(w11);
- ui::test::EventGenerator generator(root_window(), w11);
+ test::EventGenerator generator(root_window(), w11);
// First up, no one deletes anything.
tracker.Add(w11);
@@ -1227,7 +1227,7 @@ TEST_F(WindowEventDispatcherTest,
DetachesParentOnTapDelegate delegate;
scoped_ptr<Window> parent(CreateNormalWindow(22, w1.get(), NULL));
Window* child = CreateNormalWindow(11, parent.get(), &delegate);
- ui::test::EventGenerator generator(root_window(), child);
+ test::EventGenerator generator(root_window(), child);
generator.GestureTapAt(gfx::Point(40, 40));
}
@@ -1236,7 +1236,7 @@ namespace {
// A window delegate that processes nested gestures on tap.
class NestedGestureDelegate : public test::TestWindowDelegate {
public:
- NestedGestureDelegate(ui::test::EventGenerator* generator,
+ NestedGestureDelegate(test::EventGenerator* generator,
const gfx::Point tap_location)
: generator_(generator),
tap_location_(tap_location),
@@ -1264,7 +1264,7 @@ class NestedGestureDelegate : public test::TestWindowDelegate {
}
}
- ui::test::EventGenerator* generator_;
+ test::EventGenerator* generator_;
const gfx::Point tap_location_;
int gesture_end_count_;
DISALLOW_COPY_AND_ASSIGN(NestedGestureDelegate);
@@ -1278,13 +1278,13 @@ TEST_F(WindowEventDispatcherTest, GestureEndDeliveredAfterNestedGestures) {
scoped_ptr<Window> w1(CreateNormalWindow(1, root_window(), &d1));
w1->SetBounds(gfx::Rect(0, 0, 100, 100));
- ui::test::EventGenerator nested_generator(root_window(), w1.get());
+ test::EventGenerator nested_generator(root_window(), w1.get());
NestedGestureDelegate d2(&nested_generator, w1->bounds().CenterPoint());
scoped_ptr<Window> w2(CreateNormalWindow(1, root_window(), &d2));
w2->SetBounds(gfx::Rect(100, 0, 100, 100));
// Tap on w2 which triggers nested gestures for w1.
- ui::test::EventGenerator generator(root_window(), w2.get());
+ test::EventGenerator generator(root_window(), w2.get());
generator.GestureTapAt(w2->bounds().CenterPoint());
// Both windows should get their gesture end events.
@@ -1401,11 +1401,11 @@ TEST_F(WindowEventDispatcherTest, GestureRepostEventOrder) {
// Generate a tap down gesture for the repost_source. This will be reposted
// to repost_target.
- ui::test::EventGenerator repost_generator(root_window(), repost_source.get());
+ test::EventGenerator repost_generator(root_window(), repost_source.get());
repost_generator.GestureTapAt(gfx::Point(40, 40));
RunAllPendingInMessageLoop();
- ui::test::EventGenerator scroll_generator(root_window(), repost_target.get());
+ test::EventGenerator scroll_generator(root_window(), repost_target.get());
scroll_generator.GestureScrollSequence(
gfx::Point(80, 80),
gfx::Point(100, 100),
@@ -1465,7 +1465,7 @@ TEST_F(WindowEventDispatcherTest, DeleteWindowDuringMouseMovedDispatch) {
w1->SetBounds(gfx::Rect(20, 20, 60, 60));
EXPECT_EQ(NULL, host()->dispatcher()->mouse_moved_handler());
- ui::test::EventGenerator generator(root_window(), w1.get());
+ test::EventGenerator generator(root_window(), w1.get());
// Move mouse over window 1 to set it as the |mouse_moved_handler_| for the
// root window.
@@ -1966,7 +1966,7 @@ TEST_F(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) {
&delegate, 1, gfx::Rect(50, 50, 100, 100), root_window()));
window->AddPreTargetHandler(&handler);
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.GestureScrollSequence(
gfx::Point(120, 120), gfx::Point(20, 120),
base::TimeDelta::FromMilliseconds(100), 25);
@@ -2008,7 +2008,7 @@ class SelfDestructDelegate : public test::TestWindowDelegate {
};
TEST_F(WindowEventDispatcherTest, SynthesizedLocatedEvent) {
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseTo(10, 10);
EXPECT_EQ("10,10",
Env::GetInstance()->last_mouse_location().ToString());
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index a468cda..d398eb2 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -20,6 +20,7 @@
#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/aura_test_utils.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/test/window_test_api.h"
@@ -38,7 +39,6 @@
#include "ui/events/event_utils.h"
#include "ui/events/gestures/gesture_configuration.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/skia_util.h"
@@ -781,7 +781,7 @@ TEST_F(WindowTest, CaptureTests) {
EXPECT_TRUE(window->HasCapture());
EXPECT_EQ(0, delegate.capture_lost_count());
EXPECT_EQ(0, delegate.capture_changed_event_count());
- ui::test::EventGenerator generator(root_window(), gfx::Point(50, 50));
+ EventGenerator generator(root_window(), gfx::Point(50, 50));
generator.PressLeftButton();
EXPECT_EQ(1, delegate.mouse_event_count());
generator.ReleaseLeftButton();
@@ -1039,7 +1039,7 @@ TEST_F(WindowTest, ChangeCaptureWhileMouseDown) {
EXPECT_TRUE(window->HasCapture());
EXPECT_EQ(0, delegate.capture_lost_count());
EXPECT_EQ(0, delegate.capture_changed_event_count());
- ui::test::EventGenerator generator(root_window(), gfx::Point(50, 50));
+ EventGenerator generator(root_window(), gfx::Point(50, 50));
generator.PressLeftButton();
EXPECT_EQ(0, delegate.capture_lost_count());
EXPECT_EQ(0, delegate.capture_changed_event_count());
@@ -1142,7 +1142,7 @@ TEST_F(WindowTest, MouseEnterExit) {
CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(70, 70, 50, 50),
root_window()));
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w1.get());
EXPECT_TRUE(d1.entered());
EXPECT_FALSE(d1.exited());
@@ -1163,7 +1163,7 @@ TEST_F(WindowTest, WindowTreeHostExit) {
CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50),
root_window()));
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w1.get());
EXPECT_TRUE(d1.entered());
EXPECT_FALSE(d1.exited());
@@ -1189,7 +1189,7 @@ TEST_F(WindowTest, MouseEnterExitWithClick) {
CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(70, 70, 50, 50),
root_window()));
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w1.get());
EXPECT_TRUE(d1.entered());
EXPECT_FALSE(d1.exited());
@@ -1215,7 +1215,7 @@ TEST_F(WindowTest, MouseEnterExitWhenDeleteWithCapture) {
CreateTestWindowWithDelegate(&delegate, 1, gfx::Rect(10, 10, 50, 50),
root_window()));
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(window.get());
EXPECT_TRUE(delegate.entered());
EXPECT_FALSE(delegate.exited());
@@ -1243,7 +1243,7 @@ TEST_F(WindowTest, MouseEnterExitWithDelete) {
CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50),
root_window()));
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w1.get());
EXPECT_TRUE(d1.entered());
EXPECT_FALSE(d1.exited());
@@ -1277,7 +1277,7 @@ TEST_F(WindowTest, MouseEnterExitWithHide) {
CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50),
root_window()));
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w1.get());
EXPECT_TRUE(d1.entered());
EXPECT_FALSE(d1.exited());
@@ -1309,7 +1309,7 @@ TEST_F(WindowTest, MouseEnterExitWithParentHide) {
MouseEnterExitWindowDelegate d2;
Window* w2 = CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(10, 10, 50, 50),
w1.get());
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w2);
// Enters / exits can be send asynchronously.
RunAllPendingInMessageLoop();
@@ -1333,7 +1333,7 @@ TEST_F(WindowTest, MouseEnterExitWithParentDelete) {
MouseEnterExitWindowDelegate d2;
Window* w2 = CreateTestWindowWithDelegate(&d2, 2, gfx::Rect(10, 10, 50, 50),
w1.get());
- ui::test::EventGenerator generator(root_window());
+ test::EventGenerator generator(root_window());
generator.MoveMouseToCenterOf(w2);
// Enters / exits can be send asynchronously.
@@ -2024,7 +2024,7 @@ TEST_F(WindowTest, VisibilityClientIsVisible) {
TEST_F(WindowTest, MouseEventsOnWindowChange) {
gfx::Size size = host()->GetBounds().size();
- ui::test::EventGenerator generator(root_window());
+ EventGenerator generator(root_window());
generator.MoveMouseTo(50, 50);
EventCountDelegate d1;
diff --git a/ui/chromeos/touch_exploration_controller_unittest.cc b/ui/chromeos/touch_exploration_controller_unittest.cc
index 1f1155f..b00814b 100644
--- a/ui/chromeos/touch_exploration_controller_unittest.cc
+++ b/ui/chromeos/touch_exploration_controller_unittest.cc
@@ -8,12 +8,12 @@
#include "base/time/time.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/test/aura_test_base.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_cursor_client.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/gestures/gesture_provider_aura.h"
-#include "ui/events/test/event_generator.h"
#include "ui/events/test/events_test_utils.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gl/gl_implementation.h"
@@ -171,7 +171,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
aura::test::AuraTestBase::SetUp();
cursor_client_.reset(new aura::test::TestCursorClient(root_window()));
root_window()->AddPreTargetHandler(&event_capturer_);
- generator_.reset(new test::EventGenerator(root_window()));
+ generator_.reset(new aura::test::EventGenerator(root_window()));
// The generator takes ownership of the clock.
generator_->SetTickClock(scoped_ptr<base::TickClock>(simulated_clock_));
cursor_client()->ShowCursor();
@@ -315,7 +315,7 @@ class TouchExplorationTest : public aura::test::AuraTestBase {
simulated_clock_->NowTicks().ToInternalValue());
}
- scoped_ptr<test::EventGenerator> generator_;
+ scoped_ptr<aura::test::EventGenerator> generator_;
ui::GestureDetector::Config gesture_detector_config_;
// Owned by |generator_|.
base::SimpleTestTickClock* simulated_clock_;
diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc
index 7f97a5f..a39bee8 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -12,6 +12,7 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/layout_manager.h"
#include "ui/aura/test/aura_test_helper.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
@@ -26,7 +27,6 @@
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/compositor/test/layer_animator_test_controller.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/keyboard/keyboard_controller_observer.h"
#include "ui/keyboard/keyboard_controller_proxy.h"
@@ -294,7 +294,7 @@ TEST_F(KeyboardControllerTest, ClickDoesNotFocusKeyboard) {
EventObserver observer;
keyboard_container->AddPreTargetHandler(&observer);
- ui::test::EventGenerator generator(root_window());
+ aura::test::EventGenerator generator(root_window());
generator.MoveMouseTo(proxy()->GetKeyboardWindow()->bounds().CenterPoint());
generator.ClickLeftButton();
EXPECT_TRUE(window->HasFocus());
diff --git a/ui/views/corewm/capture_controller_unittest.cc b/ui/views/corewm/capture_controller_unittest.cc
index 9a536ae..ffece4a 100644
--- a/ui/views/corewm/capture_controller_unittest.cc
+++ b/ui/views/corewm/capture_controller_unittest.cc
@@ -7,13 +7,13 @@
#include "base/logging.h"
#include "ui/aura/env.h"
#include "ui/aura/test/aura_test_base.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
-#include "ui/events/test/event_generator.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/view.h"
#include "ui/views/widget/root_view.h"
@@ -137,7 +137,7 @@ TEST_F(CaptureControllerTest, ResetOtherWindowCaptureOnCapture) {
TEST_F(CaptureControllerTest, TouchTargetResetOnCaptureChange) {
// Create a window inside the WindowEventDispatcher.
scoped_ptr<aura::Window> w1(CreateNormalWindow(1, root_window(), NULL));
- ui::test::EventGenerator event_generator1(root_window());
+ aura::test::EventGenerator event_generator1(root_window());
event_generator1.PressTouch();
w1->SetCapture();
// Both capture clients should return the same capture window.
diff --git a/ui/views/corewm/desktop_capture_controller_unittest.cc b/ui/views/corewm/desktop_capture_controller_unittest.cc
index a7628a6..27736f9 100644
--- a/ui/views/corewm/desktop_capture_controller_unittest.cc
+++ b/ui/views/corewm/desktop_capture_controller_unittest.cc
@@ -7,13 +7,13 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "ui/aura/env.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/aura/window_tree_host.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/events/event.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gl/gl_surface.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/view.h"
@@ -87,7 +87,7 @@ views::Widget* CreateWidget() {
TEST_F(DesktopCaptureControllerTest, ResetMouseHandlers) {
scoped_ptr<Widget> w1(CreateWidget());
scoped_ptr<Widget> w2(CreateWidget());
- ui::test::EventGenerator generator1(w1->GetNativeView()->GetRootWindow());
+ aura::test::EventGenerator generator1(w1->GetNativeView()->GetRootWindow());
generator1.MoveMouseToCenterOf(w1->GetNativeView());
generator1.PressLeftButton();
EXPECT_FALSE(w1->HasCapture());
diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc
index 9fbb63c..8cce09c 100644
--- a/ui/views/corewm/tooltip_controller_unittest.cc
+++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -9,12 +9,12 @@
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/test/aura_test_base.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/font.h"
#include "ui/gfx/point.h"
#include "ui/gfx/screen.h"
@@ -101,7 +101,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase {
view_->SetBoundsRect(widget_->GetContentsView()->GetLocalBounds());
helper_.reset(new TooltipControllerTestHelper(
GetController(widget_.get())));
- generator_.reset(new ui::test::EventGenerator(GetRootWindow()));
+ generator_.reset(new aura::test::EventGenerator(GetRootWindow()));
}
virtual void TearDown() OVERRIDE {
@@ -137,7 +137,7 @@ class TooltipControllerTest : public aura::test::AuraTestBase {
scoped_ptr<views::Widget> widget_;
TooltipTestView* view_;
scoped_ptr<TooltipControllerTestHelper> helper_;
- scoped_ptr<ui::test::EventGenerator> generator_;
+ scoped_ptr<aura::test::EventGenerator> generator_;
private:
scoped_ptr<TooltipController> controller_;
@@ -600,7 +600,7 @@ class TooltipControllerTest2 : public aura::test::AuraTestBase {
root_window()->AddPreTargetHandler(controller_.get());
SetTooltipClient(root_window(), controller_.get());
helper_.reset(new TooltipControllerTestHelper(controller_.get()));
- generator_.reset(new ui::test::EventGenerator(root_window()));
+ generator_.reset(new aura::test::EventGenerator(root_window()));
}
virtual void TearDown() OVERRIDE {
@@ -617,7 +617,7 @@ class TooltipControllerTest2 : public aura::test::AuraTestBase {
// Owned by |controller_|.
TestTooltip* test_tooltip_;
scoped_ptr<TooltipControllerTestHelper> helper_;
- scoped_ptr<ui::test::EventGenerator> generator_;
+ scoped_ptr<aura::test::EventGenerator> generator_;
private:
scoped_ptr<TooltipController> controller_;
@@ -677,7 +677,7 @@ class TooltipControllerTest3 : public aura::test::AuraTestBase {
widget_->GetContentsView()->AddChildView(view_);
view_->SetBoundsRect(widget_->GetContentsView()->GetLocalBounds());
- generator_.reset(new ui::test::EventGenerator(GetRootWindow()));
+ generator_.reset(new aura::test::EventGenerator(GetRootWindow()));
controller_.reset(new TooltipController(
scoped_ptr<views::corewm::Tooltip>(test_tooltip_)));
GetRootWindow()->RemovePreTargetHandler(
@@ -706,7 +706,7 @@ class TooltipControllerTest3 : public aura::test::AuraTestBase {
// Owned by |controller_|.
TestTooltip* test_tooltip_;
scoped_ptr<TooltipControllerTestHelper> helper_;
- scoped_ptr<ui::test::EventGenerator> generator_;
+ scoped_ptr<aura::test::EventGenerator> generator_;
scoped_ptr<views::Widget> widget_;
TooltipTestView* view_;
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
index 73cf4f0..0af64c3 100644
--- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc
+++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -6,11 +6,11 @@
#include "base/strings/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "ui/aura/client/screen_position_client.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/touch/touch_editing_controller.h"
#include "ui/base/ui_base_switches.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -543,7 +543,7 @@ TEST_F(TouchSelectionControllerImplTest,
DoubleTapInTextfieldWithCursorHandleShouldSelectText) {
CreateTextfield();
textfield_->SetText(ASCIIToUTF16("some text"));
- ui::test::EventGenerator generator(
+ aura::test::EventGenerator generator(
textfield_->GetWidget()->GetNativeView()->GetRootWindow());
// Tap the textfield to invoke touch selection.
@@ -804,7 +804,7 @@ TEST_F(TouchSelectionControllerImplTest, MouseEventDeactivatesTouchSelection) {
CreateTextfield();
EXPECT_FALSE(GetSelectionController());
- ui::test::EventGenerator generator(
+ aura::test::EventGenerator generator(
textfield_widget_->GetNativeView()->GetRootWindow());
generator.set_current_location(gfx::Point(5, 5));
@@ -845,7 +845,7 @@ TEST_F(TouchSelectionControllerImplTest, KeyEventDeactivatesTouchSelection) {
CreateTextfield();
EXPECT_FALSE(GetSelectionController());
- ui::test::EventGenerator generator(
+ aura::test::EventGenerator generator(
textfield_widget_->GetNativeView()->GetRootWindow());
RunPendingMessages();
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
index 72bc3fb..f52fe91 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
@@ -8,10 +8,10 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/window_tree_client.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
-#include "ui/events/test/event_generator.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/widget/widget.h"
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
index 75a71ac..0451d78 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11_unittest.cc
@@ -7,11 +7,11 @@
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/hit_test.h"
#include "ui/base/x/x11_util.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/display_observer.h"
#include "ui/gfx/x/x11_types.h"
#include "ui/views/test/views_test_base.h"
@@ -290,7 +290,7 @@ TEST_F(DesktopScreenX11Test, DoubleClickHeaderMaximizes) {
DesktopWindowTreeHostX11::GetHostForXID(window->GetHost()->
GetAcceleratedWidget());
- ui::test::EventGenerator generator(window);
+ aura::test::EventGenerator generator(window);
generator.ClickLeftButton();
generator.DoubleClickLeftButton();
RunPendingMessages();
@@ -316,7 +316,7 @@ TEST_F(DesktopScreenX11Test, DoubleClickTwoDifferentTargetsDoesntMaximizes) {
DesktopWindowTreeHostX11::GetHostForXID(window->GetHost()->
GetAcceleratedWidget());
- ui::test::EventGenerator generator(window);
+ aura::test::EventGenerator generator(window);
native_widget->set_window_component(HTCLIENT);
generator.ClickLeftButton();
native_widget->set_window_component(HTCAPTION);
@@ -343,7 +343,7 @@ TEST_F(DesktopScreenX11Test, RightClickDuringDoubleClickDoesntMaximize) {
DesktopWindowTreeHostX11::GetHostForXID(window->GetHost()->
GetAcceleratedWidget()));
- ui::test::EventGenerator generator(window);
+ aura::test::EventGenerator generator(window);
native_widget->set_window_component(HTCLIENT);
generator.ClickLeftButton();
native_widget->set_window_component(HTCAPTION);
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc
index b173354..9f29b06 100644
--- a/ui/views/widget/widget_interactive_uitest.cc
+++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -11,13 +11,13 @@
#include "base/strings/utf_string_conversions.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/env.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
#include "ui/events/event_processor.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gl_surface.h"
#include "ui/views/controls/textfield/textfield.h"
@@ -769,7 +769,7 @@ TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) {
RunPendingMessages();
- ui::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow());
+ aura::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow());
generator.GestureTapAt(gfx::Point(10, 10));
ShowQuickMenuImmediately(static_cast<TouchSelectionControllerImpl*>(
textfield_test_api.touch_selection_controller()));
diff --git a/ui/wm/core/compound_event_filter_unittest.cc b/ui/wm/core/compound_event_filter_unittest.cc
index 27de90e..afd3bcb 100644
--- a/ui/wm/core/compound_event_filter_unittest.cc
+++ b/ui/wm/core/compound_event_filter_unittest.cc
@@ -7,13 +7,13 @@
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/env.h"
#include "ui/aura/test/aura_test_base.h"
+#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_cursor_client.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
-#include "ui/events/test/event_generator.h"
#include "ui/wm/core/default_activation_client.h"
#include "ui/wm/public/activation_client.h"
@@ -180,7 +180,7 @@ TEST_F(CompoundEventFilterTest, FilterConsumedGesture) {
// Tap on the window should not focus it since the filter will be consuming
// the gestures.
- ui::test::EventGenerator generator(root_window(), gfx::Point(50, 50));
+ aura::test::EventGenerator generator(root_window(), gfx::Point(50, 50));
generator.PressTouch();
EXPECT_FALSE(window->HasFocus());
@@ -191,7 +191,7 @@ TEST_F(CompoundEventFilterTest, FilterConsumedGesture) {
// Verifies we don't attempt to hide the mouse when the mouse is down and a
// touch event comes in.
TEST_F(CompoundEventFilterTest, DontHideWhenMouseDown) {
- ui::test::EventGenerator event_generator(root_window());
+ aura::test::EventGenerator event_generator(root_window());
scoped_ptr<CompoundEventFilter> compound_filter(new CompoundEventFilter);
aura::Env::GetInstance()->AddPreTargetHandler(compound_filter.get());
diff --git a/ui/wm/core/focus_controller_unittest.cc b/ui/wm/core/focus_controller_unittest.cc
index a10cef3..5d65943 100644
--- a/ui/wm/core/focus_controller_unittest.cc
+++ b/ui/wm/core/focus_controller_unittest.cc
@@ -10,6 +10,7 @@
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/client/focus_change_observer.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/test/test_windows.h"
#include "ui/aura/window.h"
@@ -20,7 +21,6 @@
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_handler.h"
-#include "ui/events/test/event_generator.h"
#include "ui/wm/core/base_focus_rules.h"
#include "ui/wm/core/wm_state.h"
#include "ui/wm/public/activation_change_observer.h"
@@ -772,7 +772,7 @@ class FocusControllerDirectTestBase : public FocusControllerTestBase {
aura::Window* w2 = root_window()->GetChildById(2);
aura::client::GetCaptureClient(root_window())->SetCapture(w2);
- ui::test::EventGenerator generator(root_window(), w2);
+ aura::test::EventGenerator generator(root_window(), w2);
generator.ClickLeftButton();
EXPECT_EQ(1, GetActiveWindowId());
@@ -909,7 +909,7 @@ class FocusControllerMouseEventTest : public FocusControllerDirectTestBase {
aura::Window* w1 = root_window()->GetChildById(1);
SimpleEventHandler handler;
root_window()->PrependPreTargetHandler(&handler);
- ui::test::EventGenerator generator(root_window(), w1);
+ aura::test::EventGenerator generator(root_window(), w1);
generator.ClickLeftButton();
EXPECT_EQ(NULL, GetActiveWindow());
generator.GestureTapAt(w1->bounds().CenterPoint());
@@ -922,17 +922,17 @@ class FocusControllerMouseEventTest : public FocusControllerDirectTestBase {
private:
// Overridden from FocusControllerTestBase:
virtual void FocusWindowDirect(aura::Window* window) OVERRIDE {
- ui::test::EventGenerator generator(root_window(), window);
+ aura::test::EventGenerator generator(root_window(), window);
generator.ClickLeftButton();
}
virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE {
- ui::test::EventGenerator generator(root_window(), window);
+ aura::test::EventGenerator generator(root_window(), window);
generator.ClickLeftButton();
}
virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE {
aura::Window* next_activatable =
test_focus_rules()->GetNextActivatableWindow(window);
- ui::test::EventGenerator generator(root_window(), next_activatable);
+ aura::test::EventGenerator generator(root_window(), next_activatable);
generator.ClickLeftButton();
}
virtual bool IsInputEvent() OVERRIDE { return true; }
@@ -947,17 +947,17 @@ class FocusControllerGestureEventTest : public FocusControllerDirectTestBase {
private:
// Overridden from FocusControllerTestBase:
virtual void FocusWindowDirect(aura::Window* window) OVERRIDE {
- ui::test::EventGenerator generator(root_window(), window);
+ aura::test::EventGenerator generator(root_window(), window);
generator.GestureTapAt(window->bounds().CenterPoint());
}
virtual void ActivateWindowDirect(aura::Window* window) OVERRIDE {
- ui::test::EventGenerator generator(root_window(), window);
+ aura::test::EventGenerator generator(root_window(), window);
generator.GestureTapAt(window->bounds().CenterPoint());
}
virtual void DeactivateWindowDirect(aura::Window* window) OVERRIDE {
aura::Window* next_activatable =
test_focus_rules()->GetNextActivatableWindow(window);
- ui::test::EventGenerator generator(root_window(), next_activatable);
+ aura::test::EventGenerator generator(root_window(), next_activatable);
generator.GestureTapAt(window->bounds().CenterPoint());
}
virtual bool IsInputEvent() OVERRIDE { return true; }
diff --git a/ui/wm/core/input_method_event_filter_unittest.cc b/ui/wm/core/input_method_event_filter_unittest.cc
index d6b37bf..50c1fbc 100644
--- a/ui/wm/core/input_method_event_filter_unittest.cc
+++ b/ui/wm/core/input_method_event_filter_unittest.cc
@@ -7,20 +7,20 @@
#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_windows.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/ime/dummy_text_input_client.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/text_input_focus_manager.h"
#include "ui/base/ui_base_switches_util.h"
-#include "ui/events/test/event_generator.h"
#include "ui/events/test/test_event_handler.h"
#include "ui/wm/core/compound_event_filter.h"
#include "ui/wm/core/default_activation_client.h"
#include "ui/wm/public/activation_client.h"
#if !defined(OS_WIN) && !defined(USE_X11)
-// On platforms except Windows and X11, ui::test::EventGenerator::PressKey
+// On platforms except Windows and X11, aura::test::EventGenerator::PressKey
// generates a key event without native_event(), which is not supported by
// ui::MockInputMethod.
#define TestInputMethodKeyEventPropagation \
@@ -103,7 +103,7 @@ TEST_F(InputMethodEventFilterTest, TestInputMethodKeyEventPropagation) {
// automatically set up by AshTestBase, consumes it and sends a new
// ui::ET_TRANSLATED_KEY_* event to the root window, which will be consumed by
// the test event filter.
- ui::test::EventGenerator generator(root_window());
+ aura::test::EventGenerator generator(root_window());
EXPECT_EQ(0, test_filter_.num_key_events());
generator.PressKey(ui::VKEY_SPACE, 0);
EXPECT_EQ(1, test_filter_.num_key_events());