| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 } | 436 } |
| 437 | 437 |
| 438 const Events& events() const { return events_; } | 438 const Events& events() const { return events_; } |
| 439 | 439 |
| 440 const EventLocations& mouse_locations() const { return mouse_locations_; } | 440 const EventLocations& mouse_locations() const { return mouse_locations_; } |
| 441 gfx::Point mouse_location(int i) const { return mouse_locations_[i]; } | 441 gfx::Point mouse_location(int i) const { return mouse_locations_[i]; } |
| 442 const EventLocations& touch_locations() const { return touch_locations_; } | 442 const EventLocations& touch_locations() const { return touch_locations_; } |
| 443 | 443 |
| 444 void WaitUntilReceivedEvent(ui::EventType type) { | 444 void WaitUntilReceivedEvent(ui::EventType type) { |
| 445 wait_until_event_ = type; | 445 wait_until_event_ = type; |
| 446 run_loop_.reset(new base::RunLoop( | 446 run_loop_.reset(new base::RunLoop()); |
| 447 Env::GetInstance()->GetDispatcher())); | |
| 448 run_loop_->Run(); | 447 run_loop_->Run(); |
| 449 } | 448 } |
| 450 | 449 |
| 451 Events GetAndResetEvents() { | 450 Events GetAndResetEvents() { |
| 452 Events events = events_; | 451 Events events = events_; |
| 453 Reset(); | 452 Reset(); |
| 454 return events; | 453 return events; |
| 455 } | 454 } |
| 456 | 455 |
| 457 void Reset() { | 456 void Reset() { |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_SCROLL_END GESTURE_END", | 1671 EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_SCROLL_END GESTURE_END", |
| 1673 EventTypesToString(events)); | 1672 EventTypesToString(events)); |
| 1674 ASSERT_EQ(2u, filter->touch_locations().size()); | 1673 ASSERT_EQ(2u, filter->touch_locations().size()); |
| 1675 EXPECT_EQ(gfx::Point(-40, 10).ToString(), | 1674 EXPECT_EQ(gfx::Point(-40, 10).ToString(), |
| 1676 filter->touch_locations()[0].ToString()); | 1675 filter->touch_locations()[0].ToString()); |
| 1677 EXPECT_EQ(gfx::Point(-40, 10).ToString(), | 1676 EXPECT_EQ(gfx::Point(-40, 10).ToString(), |
| 1678 filter->touch_locations()[1].ToString()); | 1677 filter->touch_locations()[1].ToString()); |
| 1679 } | 1678 } |
| 1680 | 1679 |
| 1681 } // namespace aura | 1680 } // namespace aura |
| OLD | NEW |