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 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 press.set_radius_x(40); | 2543 press.set_radius_x(40); |
2544 DispatchEventUsingWindowDispatcher(&press); | 2544 DispatchEventUsingWindowDispatcher(&press); |
2545 EXPECT_TRUE(delegate->tap_down()); | 2545 EXPECT_TRUE(delegate->tap_down()); |
2546 EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(), | 2546 EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(), |
2547 delegate->bounding_box().ToString()); | 2547 delegate->bounding_box().ToString()); |
2548 delegate->Reset(); | 2548 delegate->Reset(); |
2549 | 2549 |
2550 ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now()); | 2550 ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now()); |
2551 DispatchEventUsingWindowDispatcher(&press2); | 2551 DispatchEventUsingWindowDispatcher(&press2); |
2552 | 2552 |
2553 // This new press should not generate a tap-down. | 2553 // FIXME(tdresser): this should not generate a tap down; however, |
2554 EXPECT_FALSE(delegate->begin()); | 2554 // there is at least one case where we need to allow a touch press |
| 2555 // from a currently used touch id. See crbug.com/373125 for details. |
| 2556 EXPECT_TRUE(delegate->begin()); |
2555 EXPECT_FALSE(delegate->tap_down()); | 2557 EXPECT_FALSE(delegate->tap_down()); |
2556 EXPECT_FALSE(delegate->tap_cancel()); | 2558 EXPECT_TRUE(delegate->tap_cancel()); |
2557 EXPECT_FALSE(delegate->scroll_begin()); | 2559 EXPECT_FALSE(delegate->scroll_begin()); |
2558 } | 2560 } |
2559 | 2561 |
2560 TEST_F(GestureRecognizerTest, TwoFingerTap) { | 2562 TEST_F(GestureRecognizerTest, TwoFingerTap) { |
2561 scoped_ptr<GestureEventConsumeDelegate> delegate( | 2563 scoped_ptr<GestureEventConsumeDelegate> delegate( |
2562 new GestureEventConsumeDelegate()); | 2564 new GestureEventConsumeDelegate()); |
2563 const int kWindowWidth = 123; | 2565 const int kWindowWidth = 123; |
2564 const int kWindowHeight = 45; | 2566 const int kWindowHeight = 45; |
2565 const int kTouchId1 = 2; | 2567 const int kTouchId1 = 2; |
2566 const int kTouchId2 = 3; | 2568 const int kTouchId2 = 3; |
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4427 // The synchronous ack is stuck behind the pending touch move. | 4429 // The synchronous ack is stuck behind the pending touch move. |
4428 EXPECT_0_EVENTS(delegate->events()); | 4430 EXPECT_0_EVENTS(delegate->events()); |
4429 | 4431 |
4430 delegate->ReceivedAck(); | 4432 delegate->ReceivedAck(); |
4431 EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE, | 4433 EXPECT_2_EVENTS(delegate->events(), ui::ET_GESTURE_SCROLL_UPDATE, |
4432 ui::ET_GESTURE_SCROLL_UPDATE); | 4434 ui::ET_GESTURE_SCROLL_UPDATE); |
4433 } | 4435 } |
4434 | 4436 |
4435 } // namespace test | 4437 } // namespace test |
4436 } // namespace aura | 4438 } // namespace aura |
OLD | NEW |