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/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 EXPECT_EQ(2, delegate1.gesture_event_count()); | 817 EXPECT_EQ(2, delegate1.gesture_event_count()); |
818 delegate1.ResetCounts(); | 818 delegate1.ResetCounts(); |
819 | 819 |
820 // Capturing to w2 should cause the touch to be canceled. | 820 // Capturing to w2 should cause the touch to be canceled. |
821 w2->SetCapture(); | 821 w2->SetCapture(); |
822 EXPECT_EQ(1, delegate1.touch_event_count()); | 822 EXPECT_EQ(1, delegate1.touch_event_count()); |
823 EXPECT_EQ(0, delegate2.touch_event_count()); | 823 EXPECT_EQ(0, delegate2.touch_event_count()); |
824 delegate1.ResetCounts(); | 824 delegate1.ResetCounts(); |
825 delegate2.ResetCounts(); | 825 delegate2.ResetCounts(); |
826 | 826 |
827 // Events now go to w2. | 827 // Events are now untargetted. |
828 ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime()); | 828 ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime()); |
829 DispatchEventUsingWindowDispatcher(&move); | 829 DispatchEventUsingWindowDispatcher(&move); |
830 EXPECT_EQ(0, delegate1.gesture_event_count()); | 830 EXPECT_EQ(0, delegate1.gesture_event_count()); |
831 EXPECT_EQ(0, delegate1.touch_event_count()); | 831 EXPECT_EQ(0, delegate1.touch_event_count()); |
832 EXPECT_EQ(0, delegate2.gesture_event_count()); | 832 EXPECT_EQ(0, delegate2.gesture_event_count()); |
833 EXPECT_EQ(1, delegate2.touch_event_count()); | 833 EXPECT_EQ(0, delegate2.touch_event_count()); |
834 | 834 |
835 ui::TouchEvent release( | 835 ui::TouchEvent release( |
836 ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime()); | 836 ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime()); |
837 DispatchEventUsingWindowDispatcher(&release); | 837 DispatchEventUsingWindowDispatcher(&release); |
838 EXPECT_EQ(0, delegate1.gesture_event_count()); | 838 EXPECT_EQ(0, delegate1.gesture_event_count()); |
839 EXPECT_EQ(0, delegate2.gesture_event_count()); | 839 EXPECT_EQ(0, delegate2.gesture_event_count()); |
840 | 840 |
841 // A new press is captured by w2. | 841 // A new press is captured by w2. |
842 ui::TouchEvent press2( | 842 ui::TouchEvent press2( |
843 ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); | 843 ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); |
(...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3461 | 3461 |
3462 EXPECT_TRUE(animator.get()); | 3462 EXPECT_TRUE(animator.get()); |
3463 EXPECT_FALSE(animator->is_animating()); | 3463 EXPECT_FALSE(animator->is_animating()); |
3464 EXPECT_TRUE(observer.animation_completed()); | 3464 EXPECT_TRUE(observer.animation_completed()); |
3465 EXPECT_FALSE(observer.animation_aborted()); | 3465 EXPECT_FALSE(observer.animation_aborted()); |
3466 animator->RemoveObserver(&observer); | 3466 animator->RemoveObserver(&observer); |
3467 } | 3467 } |
3468 | 3468 |
3469 } // namespace test | 3469 } // namespace test |
3470 } // namespace aura | 3470 } // namespace aura |
OLD | NEW |