OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/chromeos/touch_exploration_controller.h" | 5 #include "ui/chromeos/touch_exploration_controller.h" |
6 | 6 |
7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ui/compositor/test/draw_waiter_for_test.h" | 21 #include "ui/compositor/test/draw_waiter_for_test.h" |
22 #include "ui/events/event.h" | 22 #include "ui/events/event.h" |
23 #include "ui/events/event_utils.h" | 23 #include "ui/events/event_utils.h" |
24 #include "ui/events/test/event_generator.h" | 24 #include "ui/events/test/event_generator.h" |
25 #include "ui/events/test/test_event_handler.h" | 25 #include "ui/events/test/test_event_handler.h" |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
28 | 28 |
29 class TouchExplorationTest : public InProcessBrowserTest { | 29 class TouchExplorationTest : public InProcessBrowserTest { |
30 public: | 30 public: |
31 TouchExplorationTest() : simulated_clock_(new base::SimpleTestTickClock()) { | 31 TouchExplorationTest() |
32 // Tests fail if time is ever 0. | 32 : // Tests fail if time is ever 0. |
33 simulated_clock_->Advance(base::TimeDelta::FromMilliseconds(10)); | 33 simulated_clock_(new base::SimpleTestTickClock( |
34 } | 34 base::TimeTicks() + base::TimeDelta::FromMilliseconds(10))) {} |
35 ~TouchExplorationTest() override {} | 35 ~TouchExplorationTest() override {} |
36 | 36 |
37 protected: | 37 protected: |
38 void SetUpOnMainThread() override { | 38 void SetUpOnMainThread() override { |
39 // The RenderView for WebContents is created as a result of the | 39 // The RenderView for WebContents is created as a result of the |
40 // navigation to the New Tab page which is done as part of the test | 40 // navigation to the New Tab page which is done as part of the test |
41 // SetUp. The creation involves sending a resize message to the renderer | 41 // SetUp. The creation involves sending a resize message to the renderer |
42 // process. Here we wait for the resize ack to be received, because | 42 // process. Here we wait for the resize ack to be received, because |
43 // currently WindowEventDispatcher has code to hold touch and mouse | 43 // currently WindowEventDispatcher has code to hold touch and mouse |
44 // move events until resize is complete (crbug.com/384342) which | 44 // move events until resize is complete (crbug.com/384342) which |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 // Continuing to move the touch exploration finger should send more mouse | 246 // Continuing to move the touch exploration finger should send more mouse |
247 // events. | 247 // events. |
248 generator.MoveTouchId(gfx::Point(509, 609), 1); | 248 generator.MoveTouchId(gfx::Point(509, 609), 1); |
249 EXPECT_EQ(0, event_handler_->num_touch_events()); | 249 EXPECT_EQ(0, event_handler_->num_touch_events()); |
250 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); | 250 EXPECT_TRUE(cursor_client->IsMouseEventsEnabled()); |
251 EXPECT_FALSE(cursor_client->IsCursorVisible()); | 251 EXPECT_FALSE(cursor_client->IsCursorVisible()); |
252 } | 252 } |
253 | 253 |
254 } // namespace ui | 254 } // namespace ui |
OLD | NEW |