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. |
sadrul
2014/12/03 21:30:11
Why?
tdresser
2014/12/05 16:44:31
Window 2 sees an invalid touch event stream (a mov
sadrul
2014/12/07 17:25:44
I was under the impression that existing GR sequen
tdresser
2014/12/08 14:49:30
We do transfer gesture sequences sometimes, but (I
| |
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 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3441 | 3441 |
3442 EXPECT_TRUE(animator.get()); | 3442 EXPECT_TRUE(animator.get()); |
3443 EXPECT_FALSE(animator->is_animating()); | 3443 EXPECT_FALSE(animator->is_animating()); |
3444 EXPECT_TRUE(observer.animation_completed()); | 3444 EXPECT_TRUE(observer.animation_completed()); |
3445 EXPECT_FALSE(observer.animation_aborted()); | 3445 EXPECT_FALSE(observer.animation_aborted()); |
3446 animator->RemoveObserver(&observer); | 3446 animator->RemoveObserver(&observer); |
3447 } | 3447 } |
3448 | 3448 |
3449 } // namespace test | 3449 } // namespace test |
3450 } // namespace aura | 3450 } // namespace aura |
OLD | NEW |