Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Side by Side Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 1907323003: Drag and drop cleans up touch sequences from the source window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.cc ('k') | ui/aura/window_event_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2533 SetTouchRadius(&press, 40, 0); 2533 SetTouchRadius(&press, 40, 0);
2534 DispatchEventUsingWindowDispatcher(&press); 2534 DispatchEventUsingWindowDispatcher(&press);
2535 EXPECT_TRUE(delegate->tap_down()); 2535 EXPECT_TRUE(delegate->tap_down());
2536 EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(), 2536 EXPECT_EQ(gfx::Rect(5, 5, 80, 80).ToString(),
2537 delegate->bounding_box().ToString()); 2537 delegate->bounding_box().ToString());
2538 delegate->Reset(); 2538 delegate->Reset();
2539 2539
2540 ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now()); 2540 ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(55, 45), 7, tes.Now());
2541 DispatchEventUsingWindowDispatcher(&press2); 2541 DispatchEventUsingWindowDispatcher(&press2);
2542 2542
2543 // FIXME(tdresser): this should not generate a tap down; however, 2543 EXPECT_FALSE(delegate->begin());
2544 // there is at least one case where we need to allow a touch press 2544 EXPECT_FALSE(delegate->tap_down());
2545 // from a currently used touch id. See crbug.com/373125 for details. 2545 EXPECT_FALSE(delegate->tap_cancel());
2546 EXPECT_TRUE(delegate->begin());
2547 EXPECT_TRUE(delegate->tap_down());
2548 EXPECT_TRUE(delegate->tap_cancel());
2549 EXPECT_FALSE(delegate->scroll_begin()); 2546 EXPECT_FALSE(delegate->scroll_begin());
2550 } 2547 }
2551 2548
2552 TEST_F(GestureRecognizerTest, TwoFingerTap) { 2549 TEST_F(GestureRecognizerTest, TwoFingerTap) {
2553 std::unique_ptr<GestureEventConsumeDelegate> delegate( 2550 std::unique_ptr<GestureEventConsumeDelegate> delegate(
2554 new GestureEventConsumeDelegate()); 2551 new GestureEventConsumeDelegate());
2555 const int kWindowWidth = 123; 2552 const int kWindowWidth = 123;
2556 const int kWindowHeight = 45; 2553 const int kWindowHeight = 45;
2557 const int kTouchId1 = 2; 2554 const int kTouchId1 = 2;
2558 const int kTouchId2 = 3; 2555 const int kTouchId2 = 3;
(...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after
4442 EXPECT_FALSE(queued_delegate2->long_press()); 4439 EXPECT_FALSE(queued_delegate2->long_press());
4443 4440
4444 queued_delegate->Reset(); 4441 queued_delegate->Reset();
4445 queued_delegate->WaitUntilReceivedGesture(ui::ET_GESTURE_SHOW_PRESS); 4442 queued_delegate->WaitUntilReceivedGesture(ui::ET_GESTURE_SHOW_PRESS);
4446 EXPECT_TRUE(queued_delegate->show_press()); 4443 EXPECT_TRUE(queued_delegate->show_press());
4447 EXPECT_FALSE(queued_delegate->tap_down()); 4444 EXPECT_FALSE(queued_delegate->tap_down());
4448 } 4445 }
4449 4446
4450 } // namespace test 4447 } // namespace test
4451 } // namespace aura 4448 } // namespace aura
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_drag_controller.cc ('k') | ui/aura/window_event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698