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

Side by Side Diff: ui/events/gestures/gesture_provider_aura_unittest.cc

Issue 510793003: Remove ui::TouchEvent -> blink::WebTouchEvent conversion methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken test. Created 5 years, 11 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 | « ui/events/gestures/gesture_provider_aura.cc ('k') | ui/events/gestures/motion_event_aura.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/events/event_utils.h" 8 #include "ui/events/event_utils.h"
9 #include "ui/events/gestures/gesture_provider_aura.h" 9 #include "ui/events/gestures/gesture_provider_aura.h"
10 10
(...skipping 19 matching lines...) Expand all
30 base::MessageLoopForUI message_loop_; 30 base::MessageLoopForUI message_loop_;
31 }; 31 };
32 32
33 TEST_F(GestureProviderAuraTest, IgnoresExtraPressEvents) { 33 TEST_F(GestureProviderAuraTest, IgnoresExtraPressEvents) {
34 base::TimeDelta time = ui::EventTimeForNow(); 34 base::TimeDelta time = ui::EventTimeForNow();
35 TouchEvent press1(ET_TOUCH_PRESSED, gfx::PointF(10, 10), 0, time); 35 TouchEvent press1(ET_TOUCH_PRESSED, gfx::PointF(10, 10), 0, time);
36 EXPECT_TRUE(provider()->OnTouchEvent(&press1)); 36 EXPECT_TRUE(provider()->OnTouchEvent(&press1));
37 37
38 time += base::TimeDelta::FromMilliseconds(10); 38 time += base::TimeDelta::FromMilliseconds(10);
39 TouchEvent press2(ET_TOUCH_PRESSED, gfx::PointF(30, 40), 0, time); 39 TouchEvent press2(ET_TOUCH_PRESSED, gfx::PointF(30, 40), 0, time);
40 // Redundant press with same id is ignored. 40 // TODO(tdresser): this redundant press with same id should be
41 EXPECT_FALSE(provider()->OnTouchEvent(&press2)); 41 // ignored; however, there is at least one case where we need to
42 // allow a touch press from a currently used touch id. See
43 // crbug.com/373125 for details.
44 EXPECT_TRUE(provider()->OnTouchEvent(&press2));
42 } 45 }
43 46
44 TEST_F(GestureProviderAuraTest, IgnoresExtraMoveOrReleaseEvents) { 47 TEST_F(GestureProviderAuraTest, IgnoresExtraMoveOrReleaseEvents) {
45 base::TimeDelta time = ui::EventTimeForNow(); 48 base::TimeDelta time = ui::EventTimeForNow();
46 TouchEvent press1(ET_TOUCH_PRESSED, gfx::PointF(10, 10), 0, time); 49 TouchEvent press1(ET_TOUCH_PRESSED, gfx::PointF(10, 10), 0, time);
47 EXPECT_TRUE(provider()->OnTouchEvent(&press1)); 50 EXPECT_TRUE(provider()->OnTouchEvent(&press1));
48 51
49 time += base::TimeDelta::FromMilliseconds(10); 52 time += base::TimeDelta::FromMilliseconds(10);
50 TouchEvent release1(ET_TOUCH_RELEASED, gfx::PointF(30, 40), 0, time); 53 TouchEvent release1(ET_TOUCH_RELEASED, gfx::PointF(30, 40), 0, time);
51 EXPECT_TRUE(provider()->OnTouchEvent(&release1)); 54 EXPECT_TRUE(provider()->OnTouchEvent(&release1));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 time, 146 time,
144 kRadiusX, 147 kRadiusX,
145 kRadiusY + 1, 148 kRadiusY + 1,
146 kAngle, 149 kAngle,
147 kForce); 150 kForce);
148 } 151 }
149 152
150 // TODO(jdduke): Test whether event marked as scroll trigger. 153 // TODO(jdduke): Test whether event marked as scroll trigger.
151 154
152 } // namespace ui 155 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.cc ('k') | ui/events/gestures/motion_event_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698