| Index: chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
|
| index 2eaf3c7105c762b390caecab60893a86efd665c8..148f1f3845c312b3d1e44ef60270c76375da8da1 100644
|
| --- a/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
|
| +++ b/chrome/browser/chromeos/accessibility/touch_exploration_controller_browsertest.cc
|
| @@ -7,8 +7,6 @@
|
| #include "ash/accessibility_delegate.h"
|
| #include "ash/shell.h"
|
| #include "ash/test/ash_test_base.h"
|
| -#include "base/test/simple_test_tick_clock.h"
|
| -#include "base/time/time.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| @@ -18,18 +16,13 @@
|
| #include "ui/aura/window_tree_host.h"
|
| #include "ui/compositor/compositor.h"
|
| #include "ui/compositor/test/draw_waiter_for_test.h"
|
| -#include "ui/events/event.h"
|
| -#include "ui/events/event_utils.h"
|
| #include "ui/events/test/test_event_handler.h"
|
|
|
| namespace ui {
|
|
|
| class TouchExplorationTest : public InProcessBrowserTest {
|
| public:
|
| - TouchExplorationTest() : simulated_clock_(new base::SimpleTestTickClock()) {
|
| - // Tests fail if time is ever 0.
|
| - simulated_clock_->Advance(base::TimeDelta::FromMilliseconds(10));
|
| - }
|
| + TouchExplorationTest() {}
|
| virtual ~TouchExplorationTest() {}
|
|
|
| protected:
|
| @@ -39,14 +32,6 @@
|
| if (on != ad->IsSpokenFeedbackEnabled())
|
| ad->ToggleSpokenFeedback(ash::A11Y_NOTIFICATION_NONE);
|
| }
|
| -
|
| - base::TimeDelta Now() {
|
| - return base::TimeDelta::FromInternalValue(
|
| - simulated_clock_->NowTicks().ToInternalValue());
|
| - }
|
| -
|
| - ui::GestureDetector::Config gesture_detector_config_;
|
| - base::SimpleTestTickClock* simulated_clock_;
|
|
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(TouchExplorationTest);
|
| @@ -72,26 +57,13 @@
|
| SwitchTouchExplorationMode(true);
|
| aura::test::EventGenerator generator(root_window);
|
|
|
| - base::TimeDelta initial_time = Now();
|
| - ui::TouchEvent initial_press(
|
| - ui::ET_TOUCH_PRESSED, gfx::Point(100, 200), 1, initial_time);
|
| - float delta_time =
|
| - (initial_press.location() - gfx::Point(109,209)).Length() /
|
| - gesture_detector_config_.minimum_swipe_velocity;
|
| - ui::TouchEvent touch_move(
|
| - ui::ET_TOUCH_MOVED,
|
| - gfx::Point(109, 209),
|
| - 1,
|
| - initial_time + base::TimeDelta::FromSecondsD(delta_time));
|
| -
|
| - generator.Dispatch(&initial_press);
|
| -
|
| + generator.set_current_location(gfx::Point(100, 200));
|
| + generator.PressTouchId(1);
|
| // Since the touch exploration controller doesn't know if the user is
|
| // double-tapping or not, touch exploration is only initiated if the
|
| // user moves more than 8 pixels away from the initial location (the "slop"),
|
| - // or after 300 ms has elapsed if the finger does not move fast enough.
|
| - generator.Dispatch(&touch_move);
|
| -
|
| + // or after 300 ms has elapsed.
|
| + generator.MoveTouchId(gfx::Point(109, 209), 1);
|
| // Number of mouse events may be greater than 1 because of ET_MOUSE_ENTERED.
|
| EXPECT_GT(event_handler->num_mouse_events(), 0);
|
| EXPECT_EQ(0, event_handler->num_touch_events());
|
| @@ -104,20 +76,9 @@
|
| event_handler->Reset();
|
|
|
| SwitchTouchExplorationMode(true);
|
| - initial_time = Now();
|
| - ui::TouchEvent second_initial_press(
|
| - ui::ET_TOUCH_PRESSED, gfx::Point(500, 600), 2, initial_time);
|
| - delta_time =
|
| - (second_initial_press.location() - gfx::Point(509, 609)).Length() /
|
| - gesture_detector_config_.minimum_swipe_velocity;
|
| - ui::TouchEvent second_move(
|
| - ui::ET_TOUCH_MOVED,
|
| - gfx::Point(509, 609),
|
| - 2,
|
| - initial_time + base::TimeDelta::FromSecondsD(delta_time));
|
| -
|
| - generator.Dispatch(&second_initial_press);
|
| - generator.Dispatch(&second_move);
|
| + generator.set_current_location(gfx::Point(500, 600));
|
| + generator.PressTouchId(2);
|
| + generator.MoveTouchId(gfx::Point(509, 609), 2);
|
| EXPECT_GT(event_handler->num_mouse_events(), 0);
|
| EXPECT_EQ(0, event_handler->num_touch_events());
|
|
|
|
|