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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 EXPECT_EQ(2, delegate1.gesture_event_count()); | 825 EXPECT_EQ(2, delegate1.gesture_event_count()); |
826 delegate1.ResetCounts(); | 826 delegate1.ResetCounts(); |
827 | 827 |
828 // Capturing to w2 should cause the touch to be canceled. | 828 // Capturing to w2 should cause the touch to be canceled. |
829 w2->SetCapture(); | 829 w2->SetCapture(); |
830 EXPECT_EQ(1, delegate1.touch_event_count()); | 830 EXPECT_EQ(1, delegate1.touch_event_count()); |
831 EXPECT_EQ(0, delegate2.touch_event_count()); | 831 EXPECT_EQ(0, delegate2.touch_event_count()); |
832 delegate1.ResetCounts(); | 832 delegate1.ResetCounts(); |
833 delegate2.ResetCounts(); | 833 delegate2.ResetCounts(); |
834 | 834 |
835 // Events are ignored by w2, as it's receiving a partial touch stream. | 835 // Events now go to w2. |
836 ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime()); | 836 ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime()); |
837 DispatchEventUsingWindowDispatcher(&move); | 837 DispatchEventUsingWindowDispatcher(&move); |
838 EXPECT_EQ(0, delegate1.gesture_event_count()); | 838 EXPECT_EQ(0, delegate1.gesture_event_count()); |
839 EXPECT_EQ(0, delegate1.touch_event_count()); | 839 EXPECT_EQ(0, delegate1.touch_event_count()); |
840 EXPECT_EQ(0, delegate2.gesture_event_count()); | 840 EXPECT_EQ(0, delegate2.gesture_event_count()); |
841 EXPECT_EQ(0, delegate2.touch_event_count()); | 841 EXPECT_EQ(1, delegate2.touch_event_count()); |
842 | 842 |
843 ui::TouchEvent release( | 843 ui::TouchEvent release( |
844 ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime()); | 844 ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime()); |
845 DispatchEventUsingWindowDispatcher(&release); | 845 DispatchEventUsingWindowDispatcher(&release); |
846 EXPECT_EQ(0, delegate1.gesture_event_count()); | 846 EXPECT_EQ(0, delegate1.gesture_event_count()); |
847 EXPECT_EQ(0, delegate2.gesture_event_count()); | 847 EXPECT_EQ(0, delegate2.gesture_event_count()); |
848 | 848 |
849 // A new press is captured by w2. | 849 // A new press is captured by w2. |
850 ui::TouchEvent press2( | 850 ui::TouchEvent press2( |
851 ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); | 851 ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime()); |
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3428 | 3428 |
3429 EXPECT_TRUE(animator.get()); | 3429 EXPECT_TRUE(animator.get()); |
3430 EXPECT_FALSE(animator->is_animating()); | 3430 EXPECT_FALSE(animator->is_animating()); |
3431 EXPECT_TRUE(observer.animation_completed()); | 3431 EXPECT_TRUE(observer.animation_completed()); |
3432 EXPECT_FALSE(observer.animation_aborted()); | 3432 EXPECT_FALSE(observer.animation_aborted()); |
3433 animator->RemoveObserver(&observer); | 3433 animator->RemoveObserver(&observer); |
3434 } | 3434 } |
3435 | 3435 |
3436 } // namespace test | 3436 } // namespace test |
3437 } // namespace aura | 3437 } // namespace aura |
OLD | NEW |