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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 public: | 593 public: |
594 RemoveOnTouchCancelHandler() {} | 594 RemoveOnTouchCancelHandler() {} |
595 ~RemoveOnTouchCancelHandler() override {} | 595 ~RemoveOnTouchCancelHandler() override {} |
596 | 596 |
597 private: | 597 private: |
598 // ui::EventHandler: | 598 // ui::EventHandler: |
599 void OnTouchEvent(ui::TouchEvent* event) override { | 599 void OnTouchEvent(ui::TouchEvent* event) override { |
600 TestEventHandler::OnTouchEvent(event); | 600 TestEventHandler::OnTouchEvent(event); |
601 if (event->type() == ui::ET_TOUCH_CANCELLED) { | 601 if (event->type() == ui::ET_TOUCH_CANCELLED) { |
602 Window* target = static_cast<Window*>(event->target()); | 602 Window* target = static_cast<Window*>(event->target()); |
603 // This is tiptoeing around crbug.com/310172. If this event handler isn't | |
604 // removed, we enter an infinite loop. | |
605 target->RemovePreTargetHandler(this); | |
606 target->parent()->RemoveChild(target); | 603 target->parent()->RemoveChild(target); |
607 } | 604 } |
608 } | 605 } |
609 | 606 |
610 DISALLOW_COPY_AND_ASSIGN(RemoveOnTouchCancelHandler); | 607 DISALLOW_COPY_AND_ASSIGN(RemoveOnTouchCancelHandler); |
611 }; | 608 }; |
612 | 609 |
613 void DelayByLongPressTimeout() { | 610 void DelayByLongPressTimeout() { |
614 ui::GestureProvider::Config config; | 611 ui::GestureProvider::Config config; |
615 base::RunLoop run_loop; | 612 base::RunLoop run_loop; |
(...skipping 3739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4355 // The synchronous ack is stuck behind the pending touch move. | 4352 // The synchronous ack is stuck behind the pending touch move. |
4356 EXPECT_0_EVENTS(delegate->events()); | 4353 EXPECT_0_EVENTS(delegate->events()); |
4357 | 4354 |
4358 delegate->ReceivedAck(); | 4355 delegate->ReceivedAck(); |
4359 EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE, | 4356 EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE, |
4360 ui::ET_GESTURE_SCROLL_UPDATE); | 4357 ui::ET_GESTURE_SCROLL_UPDATE); |
4361 } | 4358 } |
4362 | 4359 |
4363 } // namespace test | 4360 } // namespace test |
4364 } // namespace aura | 4361 } // namespace aura |
OLD | NEW |