1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/basictypes.h"
6 #include "base/memory/scoped_ptr.h"
7 #include "content/browser/renderer_host/input/tap_suppression_controller.h"
8 #include "content/browser/renderer_host/input/tap_suppression_controller_client.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 using base::TimeDelta
;
15 class MockTapSuppressionController
: public TapSuppressionController
,
16 public TapSuppressionControllerClient
{
18 using TapSuppressionController::DISABLED
;
19 using TapSuppressionController::NOTHING
;
20 using TapSuppressionController::GFC_IN_PROGRESS
;
21 using TapSuppressionController::TAP_DOWN_STASHED
;
22 using TapSuppressionController::LAST_CANCEL_STOPPED_FLING
;
26 TAP_DOWN_DEFERRED
= 1 << 0,
27 TAP_DOWN_FORWARDED
= 1 << 1,
28 TAP_DOWN_DROPPED
= 1 << 2,
29 TAP_UP_SUPPRESSED
= 1 << 3,
30 TAP_UP_FORWARDED
= 1 << 4,
31 TAP_CANCEL_SUPPRESSED
= 1 << 5,
32 TAP_CANCEL_FORWARDED
= 1 << 6,
33 STASHED_TAP_DOWN_FORWARDED
= 1 << 7,
36 MockTapSuppressionController(const TapSuppressionController::Config
& config
)
37 : TapSuppressionController(this, config
),
40 timer_started_(false) {}
42 ~MockTapSuppressionController() override
{}
44 void SendGestureFlingCancel() {
49 void SendGestureFlingCancelAck(bool processed
) {
51 GestureFlingCancelAck(processed
);
56 if (ShouldDeferTapDown())
57 last_actions_
|= TAP_DOWN_DEFERRED
;
59 last_actions_
|= TAP_DOWN_FORWARDED
;
64 if (ShouldSuppressTapEnd())
65 last_actions_
|= TAP_UP_SUPPRESSED
;
67 last_actions_
|= TAP_UP_FORWARDED
;
70 void SendTapCancel() {
72 if (ShouldSuppressTapEnd())
73 last_actions_
|= TAP_CANCEL_SUPPRESSED
;
75 last_actions_
|= TAP_CANCEL_FORWARDED
;
78 void AdvanceTime(const base::TimeDelta
& delta
) {
81 if (timer_started_
&& time_
>= timer_expiry_time_
) {
82 timer_started_
= false;
83 TapDownTimerExpired();
87 State
state() { return state_
; }
89 int last_actions() { return last_actions_
; }
92 base::TimeTicks
Now() override
{ return time_
; }
94 void StartTapDownTimer(const base::TimeDelta
& delay
) override
{
95 timer_expiry_time_
= time_
+ delay
;
96 timer_started_
= true;
99 void StopTapDownTimer() override
{ timer_started_
= false; }
102 // TapSuppressionControllerClient implementation
103 void DropStashedTapDown() override
{ last_actions_
|= TAP_DOWN_DROPPED
; }
105 void ForwardStashedTapDown() override
{
106 last_actions_
|= STASHED_TAP_DOWN_FORWARDED
;
109 // Hiding some derived public methods
110 using TapSuppressionController::GestureFlingCancel
;
111 using TapSuppressionController::GestureFlingCancelAck
;
112 using TapSuppressionController::ShouldDeferTapDown
;
113 using TapSuppressionController::ShouldSuppressTapEnd
;
117 base::TimeTicks time_
;
119 base::TimeTicks timer_expiry_time_
;
121 DISALLOW_COPY_AND_ASSIGN(MockTapSuppressionController
);
124 class TapSuppressionControllerTest
: public testing::Test
{
126 TapSuppressionControllerTest() {
128 ~TapSuppressionControllerTest() override
{}
132 void SetUp() override
{
133 tap_suppression_controller_
.reset(
134 new MockTapSuppressionController(GetConfig()));
137 void TearDown() override
{ tap_suppression_controller_
.reset(); }
139 static TapSuppressionController::Config
GetConfig() {
140 TapSuppressionController::Config config
;
141 config
.enabled
= true;
142 config
.max_cancel_to_down_time
= base::TimeDelta::FromMilliseconds(10);
143 config
.max_tap_gap_time
= base::TimeDelta::FromMilliseconds(10);
147 scoped_ptr
<MockTapSuppressionController
> tap_suppression_controller_
;
150 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
151 // TapDown and everything happens without any delays.
152 TEST_F(TapSuppressionControllerTest
, GFCAckBeforeTapFast
) {
153 // Send GestureFlingCancel.
154 tap_suppression_controller_
->SendGestureFlingCancel();
155 EXPECT_EQ(MockTapSuppressionController::NONE
,
156 tap_suppression_controller_
->last_actions());
157 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
158 tap_suppression_controller_
->state());
160 // Send GestureFlingCancel Ack.
161 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
162 EXPECT_EQ(MockTapSuppressionController::NONE
,
163 tap_suppression_controller_
->last_actions());
164 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
165 tap_suppression_controller_
->state());
167 // Send TapDown. This TapDown should be suppressed.
168 tap_suppression_controller_
->SendTapDown();
169 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
170 tap_suppression_controller_
->last_actions());
171 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
172 tap_suppression_controller_
->state());
174 // Send TapUp. This TapUp should be suppressed.
175 tap_suppression_controller_
->SendTapUp();
176 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED
|
177 MockTapSuppressionController::TAP_DOWN_DROPPED
,
178 tap_suppression_controller_
->last_actions());
179 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
180 tap_suppression_controller_
->state());
183 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
184 // TapDown, but there is a small delay between TapDown and TapUp.
185 TEST_F(TapSuppressionControllerTest
, GFCAckBeforeTapInsufficientlyLateTapUp
) {
186 // Send GestureFlingCancel.
187 tap_suppression_controller_
->SendGestureFlingCancel();
188 EXPECT_EQ(MockTapSuppressionController::NONE
,
189 tap_suppression_controller_
->last_actions());
190 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
191 tap_suppression_controller_
->state());
193 // Send GestureFlingCancel Ack.
194 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
195 EXPECT_EQ(MockTapSuppressionController::NONE
,
196 tap_suppression_controller_
->last_actions());
197 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
198 tap_suppression_controller_
->state());
200 // Send TapDown. This TapDown should be suppressed.
201 tap_suppression_controller_
->SendTapDown();
202 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
203 tap_suppression_controller_
->last_actions());
204 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
205 tap_suppression_controller_
->state());
207 // Wait less than allowed delay between TapDown and TapUp, so they are still
209 tap_suppression_controller_
->AdvanceTime(TimeDelta::FromMilliseconds(7));
210 EXPECT_EQ(MockTapSuppressionController::NONE
,
211 tap_suppression_controller_
->last_actions());
212 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
213 tap_suppression_controller_
->state());
215 // Send TapUp. This TapUp should be suppressed.
216 tap_suppression_controller_
->SendTapUp();
217 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED
|
218 MockTapSuppressionController::TAP_DOWN_DROPPED
,
219 tap_suppression_controller_
->last_actions());
220 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
221 tap_suppression_controller_
->state());
224 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
225 // TapDown, but there is a long delay between TapDown and TapUp.
226 TEST_F(TapSuppressionControllerTest
, GFCAckBeforeTapSufficientlyLateTapUp
) {
227 // Send GestureFlingCancel.
228 tap_suppression_controller_
->SendGestureFlingCancel();
229 EXPECT_EQ(MockTapSuppressionController::NONE
,
230 tap_suppression_controller_
->last_actions());
231 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
232 tap_suppression_controller_
->state());
234 // Send processed GestureFlingCancel Ack.
235 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
236 EXPECT_EQ(MockTapSuppressionController::NONE
,
237 tap_suppression_controller_
->last_actions());
238 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
239 tap_suppression_controller_
->state());
241 // Send MouseDown. This MouseDown should be suppressed, for now.
242 tap_suppression_controller_
->SendTapDown();
243 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
244 tap_suppression_controller_
->last_actions());
245 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
246 tap_suppression_controller_
->state());
248 // Wait more than allowed delay between TapDown and TapUp, so they are not
249 // considered a tap. This should release the previously suppressed TapDown.
250 tap_suppression_controller_
->AdvanceTime(TimeDelta::FromMilliseconds(13));
251 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED
,
252 tap_suppression_controller_
->last_actions());
253 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
254 tap_suppression_controller_
->state());
256 // Send TapUp. This TapUp should not be suppressed.
257 tap_suppression_controller_
->SendTapUp();
258 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED
,
259 tap_suppression_controller_
->last_actions());
260 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
261 tap_suppression_controller_
->state());
264 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
265 // TapDown, but there is a small delay between the Ack and TapDown.
266 TEST_F(TapSuppressionControllerTest
, GFCAckBeforeTapInsufficientlyLateTapDown
) {
267 // Send GestureFlingCancel.
268 tap_suppression_controller_
->SendGestureFlingCancel();
269 EXPECT_EQ(MockTapSuppressionController::NONE
,
270 tap_suppression_controller_
->last_actions());
271 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
272 tap_suppression_controller_
->state());
274 // Send GestureFlingCancel Ack.
275 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
276 EXPECT_EQ(MockTapSuppressionController::NONE
,
277 tap_suppression_controller_
->last_actions());
278 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
279 tap_suppression_controller_
->state());
281 // Wait less than allowed delay between GestureFlingCancel and TapDown, so the
282 // TapDown is still considered associated with the GestureFlingCancel.
283 tap_suppression_controller_
->AdvanceTime(TimeDelta::FromMilliseconds(7));
284 EXPECT_EQ(MockTapSuppressionController::NONE
,
285 tap_suppression_controller_
->last_actions());
286 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
287 tap_suppression_controller_
->state());
289 // Send TapDown. This TapDown should be suppressed.
290 tap_suppression_controller_
->SendTapDown();
291 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
292 tap_suppression_controller_
->last_actions());
293 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
294 tap_suppression_controller_
->state());
296 // Send TapUp. This TapUp should be suppressed.
297 tap_suppression_controller_
->SendTapUp();
298 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED
|
299 MockTapSuppressionController::TAP_DOWN_DROPPED
,
300 tap_suppression_controller_
->last_actions());
301 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
302 tap_suppression_controller_
->state());
305 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
306 // TapDown, but there is a long delay between the Ack and TapDown.
307 TEST_F(TapSuppressionControllerTest
, GFCAckBeforeTapSufficientlyLateTapDown
) {
308 // Send GestureFlingCancel.
309 tap_suppression_controller_
->SendGestureFlingCancel();
310 EXPECT_EQ(MockTapSuppressionController::NONE
,
311 tap_suppression_controller_
->last_actions());
312 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
313 tap_suppression_controller_
->state());
315 // Send GestureFlingCancel Ack.
316 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
317 EXPECT_EQ(MockTapSuppressionController::NONE
,
318 tap_suppression_controller_
->last_actions());
319 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
320 tap_suppression_controller_
->state());
322 // Wait more than allowed delay between GestureFlingCancel and TapDown, so the
323 // TapDown is not considered associated with the GestureFlingCancel.
324 tap_suppression_controller_
->AdvanceTime(TimeDelta::FromMilliseconds(13));
325 EXPECT_EQ(MockTapSuppressionController::NONE
,
326 tap_suppression_controller_
->last_actions());
327 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING
,
328 tap_suppression_controller_
->state());
330 // Send TapDown. This TapDown should not be suppressed.
331 tap_suppression_controller_
->SendTapDown();
332 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_FORWARDED
,
333 tap_suppression_controller_
->last_actions());
334 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
335 tap_suppression_controller_
->state());
337 // Send MouseUp. This MouseUp should not be suppressed.
338 tap_suppression_controller_
->SendTapUp();
339 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED
,
340 tap_suppression_controller_
->last_actions());
341 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
342 tap_suppression_controller_
->state());
345 // Test TapSuppressionController for when unprocessed GestureFlingCancel Ack
346 // comes after TapDown and everything happens without any delay.
347 TEST_F(TapSuppressionControllerTest
, GFCAckUnprocessedAfterTapFast
) {
348 // Send GestureFlingCancel.
349 tap_suppression_controller_
->SendGestureFlingCancel();
350 EXPECT_EQ(MockTapSuppressionController::NONE
,
351 tap_suppression_controller_
->last_actions());
352 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
353 tap_suppression_controller_
->state());
355 // Send TapDown. This TapDown should be suppressed, for now.
356 tap_suppression_controller_
->SendTapDown();
357 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
358 tap_suppression_controller_
->last_actions());
359 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
360 tap_suppression_controller_
->state());
362 // Send unprocessed GestureFlingCancel Ack. This should release the
363 // previously suppressed TapDown.
364 tap_suppression_controller_
->SendGestureFlingCancelAck(false);
365 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED
,
366 tap_suppression_controller_
->last_actions());
367 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
368 tap_suppression_controller_
->state());
370 // Send TapUp. This TapUp should not be suppressed.
371 tap_suppression_controller_
->SendTapUp();
372 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED
,
373 tap_suppression_controller_
->last_actions());
374 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
375 tap_suppression_controller_
->state());
378 // Test TapSuppressionController for when processed GestureFlingCancel Ack comes
379 // after TapDown and everything happens without any delay.
380 TEST_F(TapSuppressionControllerTest
, GFCAckProcessedAfterTapFast
) {
381 // Send GestureFlingCancel.
382 tap_suppression_controller_
->SendGestureFlingCancel();
383 EXPECT_EQ(MockTapSuppressionController::NONE
,
384 tap_suppression_controller_
->last_actions());
385 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
386 tap_suppression_controller_
->state());
388 // Send TapDown. This TapDown should be suppressed.
389 tap_suppression_controller_
->SendTapDown();
390 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
391 tap_suppression_controller_
->last_actions());
392 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
393 tap_suppression_controller_
->state());
395 // Send processed GestureFlingCancel Ack.
396 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
397 EXPECT_EQ(MockTapSuppressionController::NONE
,
398 tap_suppression_controller_
->last_actions());
399 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
400 tap_suppression_controller_
->state());
402 // Send TapUp. This TapUp should be suppressed.
403 tap_suppression_controller_
->SendTapUp();
404 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED
|
405 MockTapSuppressionController::TAP_DOWN_DROPPED
,
406 tap_suppression_controller_
->last_actions());
407 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
408 tap_suppression_controller_
->state());
411 // Test TapSuppressionController for when GestureFlingCancel Ack comes after
412 // TapDown and there is a small delay between the Ack and TapUp.
413 TEST_F(TapSuppressionControllerTest
, GFCAckAfterTapInsufficientlyLateTapUp
) {
414 // Send GestureFlingCancel.
415 tap_suppression_controller_
->SendGestureFlingCancel();
416 EXPECT_EQ(MockTapSuppressionController::NONE
,
417 tap_suppression_controller_
->last_actions());
418 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
419 tap_suppression_controller_
->state());
421 // Send TapDown. This TapDown should be suppressed.
422 tap_suppression_controller_
->SendTapDown();
423 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
424 tap_suppression_controller_
->last_actions());
425 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
426 tap_suppression_controller_
->state());
428 // Send GestureFlingCancel Ack.
429 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
430 EXPECT_EQ(MockTapSuppressionController::NONE
,
431 tap_suppression_controller_
->last_actions());
432 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
433 tap_suppression_controller_
->state());
435 // Wait less than allowed delay between TapDown and TapUp, so they are still
436 // considered as a tap.
437 tap_suppression_controller_
->AdvanceTime(TimeDelta::FromMilliseconds(7));
438 EXPECT_EQ(MockTapSuppressionController::NONE
,
439 tap_suppression_controller_
->last_actions());
440 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
441 tap_suppression_controller_
->state());
443 // Send TapUp. This TapUp should be suppressed.
444 tap_suppression_controller_
->SendTapUp();
445 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED
|
446 MockTapSuppressionController::TAP_DOWN_DROPPED
,
447 tap_suppression_controller_
->last_actions());
448 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
449 tap_suppression_controller_
->state());
452 // Test TapSuppressionController for when GestureFlingCancel Ack comes after
453 // TapDown and there is a long delay between the Ack and TapUp.
454 TEST_F(TapSuppressionControllerTest
, GFCAckAfterTapSufficientlyLateTapUp
) {
455 // Send GestureFlingCancel.
456 tap_suppression_controller_
->SendGestureFlingCancel();
457 EXPECT_EQ(MockTapSuppressionController::NONE
,
458 tap_suppression_controller_
->last_actions());
459 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS
,
460 tap_suppression_controller_
->state());
462 // Send TapDown. This TapDown should be suppressed, for now.
463 tap_suppression_controller_
->SendTapDown();
464 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED
,
465 tap_suppression_controller_
->last_actions());
466 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
467 tap_suppression_controller_
->state());
469 // Send GestureFlingCancel Ack.
470 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
471 EXPECT_EQ(MockTapSuppressionController::NONE
,
472 tap_suppression_controller_
->last_actions());
473 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED
,
474 tap_suppression_controller_
->state());
476 // Wait more than allowed delay between TapDown and TapUp, so they are not
477 // considered as a tap. This should release the previously suppressed TapDown.
478 tap_suppression_controller_
->AdvanceTime(TimeDelta::FromMilliseconds(13));
479 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED
,
480 tap_suppression_controller_
->last_actions());
481 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
482 tap_suppression_controller_
->state());
484 // Send TapUp. This TapUp should not be suppressed.
485 tap_suppression_controller_
->SendTapUp();
486 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED
,
487 tap_suppression_controller_
->last_actions());
488 EXPECT_EQ(MockTapSuppressionController::NOTHING
,
489 tap_suppression_controller_
->state());
492 // Test that no suppression occurs if the TapSuppressionController is disabled.
493 TEST_F(TapSuppressionControllerTest
, NoSuppressionIfDisabled
) {
494 TapSuppressionController::Config disabled_config
;
495 disabled_config
.enabled
= false;
496 tap_suppression_controller_
.reset(
497 new MockTapSuppressionController(disabled_config
));
499 // Send GestureFlingCancel.
500 tap_suppression_controller_
->SendGestureFlingCancel();
501 EXPECT_EQ(MockTapSuppressionController::NONE
,
502 tap_suppression_controller_
->last_actions());
503 EXPECT_EQ(MockTapSuppressionController::DISABLED
,
504 tap_suppression_controller_
->state());
506 // Send GestureFlingCancel Ack.
507 tap_suppression_controller_
->SendGestureFlingCancelAck(true);
508 EXPECT_EQ(MockTapSuppressionController::NONE
,
509 tap_suppression_controller_
->last_actions());
510 EXPECT_EQ(MockTapSuppressionController::DISABLED
,
511 tap_suppression_controller_
->state());
513 // Send TapDown. This TapDown should not be suppressed.
514 tap_suppression_controller_
->SendTapDown();
515 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_FORWARDED
,
516 tap_suppression_controller_
->last_actions());
517 EXPECT_EQ(MockTapSuppressionController::DISABLED
,
518 tap_suppression_controller_
->state());
520 // Send TapUp. This TapUp should not be suppressed.
521 tap_suppression_controller_
->SendTapUp();
522 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED
,
523 tap_suppression_controller_
->last_actions());
524 EXPECT_EQ(MockTapSuppressionController::DISABLED
,
525 tap_suppression_controller_
->state());
528 } // namespace content