| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 SetTouchRadius(&press, 40, 0); | 2535 SetTouchRadius(&press, 40, 0); |
| 2536 DispatchEventUsingWindowDispatcher(&press); | 2536 DispatchEventUsingWindowDispatcher(&press); |
| 2537 EXPECT_TRUE(delegate->tap_down()); | 2537 EXPECT_TRUE(delegate->tap_down()); |
| 2538 EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(), | 2538 EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(), |
| 2539 delegate->bounding_box().ToString()); | 2539 delegate->bounding_box().ToString()); |
| 2540 delegate->Reset(); | 2540 delegate->Reset(); |
| 2541 | 2541 |
| 2542 ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now()); | 2542 ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now()); |
| 2543 DispatchEventUsingWindowDispatcher(&press2); | 2543 DispatchEventUsingWindowDispatcher(&press2); |
| 2544 | 2544 |
| 2545 // FIXME(tdresser): this should not generate a tap down; however, | 2545 EXPECT_FALSE(delegate->begin()); |
| 2546 // there is at least one case where we need to allow a touch press | 2546 EXPECT_FALSE(delegate->tap_down()); |
| 2547 // from a currently used touch id. See crbug.com/373125 for details. | 2547 EXPECT_FALSE(delegate->tap_cancel()); |
| 2548 EXPECT_TRUE(delegate->begin()); | |
| 2549 EXPECT_TRUE(delegate->tap_down()); | |
| 2550 EXPECT_TRUE(delegate->tap_cancel()); | |
| 2551 EXPECT_FALSE(delegate->scroll_begin()); | 2548 EXPECT_FALSE(delegate->scroll_begin()); |
| 2552 } | 2549 } |
| 2553 | 2550 |
| 2554 TEST_F(GestureRecognizerTest, TwoFingerTap) { | 2551 TEST_F(GestureRecognizerTest, TwoFingerTap) { |
| 2555 scoped_ptr<GestureEventConsumeDelegate> delegate( | 2552 scoped_ptr<GestureEventConsumeDelegate> delegate( |
| 2556 new GestureEventConsumeDelegate()); | 2553 new GestureEventConsumeDelegate()); |
| 2557 const int kWindowWidth = 123; | 2554 const int kWindowWidth = 123; |
| 2558 const int kWindowHeight = 45; | 2555 const int kWindowHeight = 45; |
| 2559 const int kTouchId1 = 2; | 2556 const int kTouchId1 = 2; |
| 2560 const int kTouchId2 = 3; | 2557 const int kTouchId2 = 3; |
| (...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4444 EXPECT_FALSE(queued_delegate2->long_press()); | 4441 EXPECT_FALSE(queued_delegate2->long_press()); |
| 4445 | 4442 |
| 4446 queued_delegate->Reset(); | 4443 queued_delegate->Reset(); |
| 4447 queued_delegate->WaitUntilReceivedGesture(ui::ET_GESTURE_SHOW_PRESS); | 4444 queued_delegate->WaitUntilReceivedGesture(ui::ET_GESTURE_SHOW_PRESS); |
| 4448 EXPECT_TRUE(queued_delegate->show_press()); | 4445 EXPECT_TRUE(queued_delegate->show_press()); |
| 4449 EXPECT_FALSE(queued_delegate->tap_down()); | 4446 EXPECT_FALSE(queued_delegate->tap_down()); |
| 4450 } | 4447 } |
| 4451 | 4448 |
| 4452 } // namespace test | 4449 } // namespace test |
| 4453 } // namespace aura | 4450 } // namespace aura |
| OLD | NEW |