| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/location.h" | 6 #include "base/location.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 const std::vector<WebTouchEvent>& all_sent_events() const { | 290 const std::vector<WebTouchEvent>& all_sent_events() const { |
| 291 return sent_events_; | 291 return sent_events_; |
| 292 } | 292 } |
| 293 | 293 |
| 294 InputEventAckState acked_event_state() const { | 294 InputEventAckState acked_event_state() const { |
| 295 return last_acked_event_state_; | 295 return last_acked_event_state_; |
| 296 } | 296 } |
| 297 | 297 |
| 298 static void RunTasksAndWait(base::TimeDelta delay) { | 298 static void RunTasksAndWait(base::TimeDelta delay) { |
| 299 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 299 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 300 FROM_HERE, base::MessageLoop::QuitClosure(), delay); | 300 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), delay); |
| 301 base::MessageLoop::current()->Run(); | 301 base::MessageLoop::current()->Run(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 size_t uncancelable_touch_moves_pending_ack_count() const { | 304 size_t uncancelable_touch_moves_pending_ack_count() const { |
| 305 return queue_->uncancelable_touch_moves_pending_ack_count(); | 305 return queue_->uncancelable_touch_moves_pending_ack_count(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 int GetUniqueTouchEventID() { return sent_events_ids_.back(); } | 308 int GetUniqueTouchEventID() { return sent_events_ids_.back(); } |
| 309 | 309 |
| 310 private: | 310 private: |
| (...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2606 // TouchMove should be allowed and test for touches state. | 2606 // TouchMove should be allowed and test for touches state. |
| 2607 const WebTouchEvent& event2 = sent_event(); | 2607 const WebTouchEvent& event2 = sent_event(); |
| 2608 EXPECT_EQ(WebInputEvent::TouchMove, event2.type); | 2608 EXPECT_EQ(WebInputEvent::TouchMove, event2.type); |
| 2609 EXPECT_EQ(WebTouchPoint::StateStationary, event2.touches[0].state); | 2609 EXPECT_EQ(WebTouchPoint::StateStationary, event2.touches[0].state); |
| 2610 EXPECT_EQ(WebTouchPoint::StateMoved, event2.touches[1].state); | 2610 EXPECT_EQ(WebTouchPoint::StateMoved, event2.touches[1].state); |
| 2611 EXPECT_EQ(1U, GetAndResetSentEventCount()); | 2611 EXPECT_EQ(1U, GetAndResetSentEventCount()); |
| 2612 EXPECT_EQ(1U, GetAndResetAckedEventCount()); | 2612 EXPECT_EQ(1U, GetAndResetAckedEventCount()); |
| 2613 } | 2613 } |
| 2614 | 2614 |
| 2615 } // namespace content | 2615 } // namespace content |
| OLD | NEW |