| 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 <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 SwitchTouchExplorationMode(true); | 529 SwitchTouchExplorationMode(true); |
| 530 | 530 |
| 531 gfx::Point location_start(11, 12); | 531 gfx::Point location_start(11, 12); |
| 532 gfx::Point location_end(13, 14); | 532 gfx::Point location_end(13, 14); |
| 533 generator_->set_current_location(location_start); | 533 generator_->set_current_location(location_start); |
| 534 generator_->PressTouch(); | 534 generator_->PressTouch(); |
| 535 AdvanceSimulatedTimePastTapDelay(); | 535 AdvanceSimulatedTimePastTapDelay(); |
| 536 generator_->MoveTouch(location_end); | 536 generator_->MoveTouch(location_end); |
| 537 | 537 |
| 538 gfx::Point location_real_mouse_move(15, 16); | 538 gfx::Point location_real_mouse_move(15, 16); |
| 539 ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, location_real_mouse_move, | 539 ui::MouseEvent mouse_move( |
| 540 location_real_mouse_move, ui::EventTimeForNow(), 0, | 540 ui::ET_MOUSE_MOVED, location_real_mouse_move, location_real_mouse_move, |
| 541 0); | 541 ui::EventTimeForNow(), 0, 0, |
| 542 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 542 generator_->Dispatch(&mouse_move); | 543 generator_->Dispatch(&mouse_move); |
| 543 generator_->ReleaseTouch(); | 544 generator_->ReleaseTouch(); |
| 544 AdvanceSimulatedTimePastTapDelay(); | 545 AdvanceSimulatedTimePastTapDelay(); |
| 545 | 546 |
| 546 std::vector<ui::LocatedEvent*> events = | 547 std::vector<ui::LocatedEvent*> events = |
| 547 GetCapturedLocatedEventsOfType(ui::ET_MOUSE_MOVED); | 548 GetCapturedLocatedEventsOfType(ui::ET_MOUSE_MOVED); |
| 548 ASSERT_EQ(4U, events.size()); | 549 ASSERT_EQ(4U, events.size()); |
| 549 | 550 |
| 550 EXPECT_EQ(location_start, events[0]->location()); | 551 EXPECT_EQ(location_start, events[0]->location()); |
| 551 EXPECT_TRUE(events[0]->flags() & ui::EF_IS_SYNTHESIZED); | 552 EXPECT_TRUE(events[0]->flags() & ui::EF_IS_SYNTHESIZED); |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1970 AdvanceSimulatedTimePastTapDelay(); | 1971 AdvanceSimulatedTimePastTapDelay(); |
| 1971 EXPECT_TRUE(IsInNoFingersDownState()); | 1972 EXPECT_TRUE(IsInNoFingersDownState()); |
| 1972 | 1973 |
| 1973 ASSERT_EQ(1U, GetCapturedEvents().size()); | 1974 ASSERT_EQ(1U, GetCapturedEvents().size()); |
| 1974 EXPECT_EQ(ui::ET_MOUSE_MOVED, GetCapturedEvents()[0]->type()); | 1975 EXPECT_EQ(ui::ET_MOUSE_MOVED, GetCapturedEvents()[0]->type()); |
| 1975 ClearCapturedEvents(); | 1976 ClearCapturedEvents(); |
| 1976 } | 1977 } |
| 1977 } | 1978 } |
| 1978 | 1979 |
| 1979 } // namespace ui | 1980 } // namespace ui |
| OLD | NEW |