IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / renderer_host / input / tap_suppression_controller_unittest.cc
blobd436f45a4a5fe4cbc8047f4155d946d5d8b4818f
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;
13 namespace content {
15 class MockTapSuppressionController : public TapSuppressionController,
16 public TapSuppressionControllerClient {
17 public:
18 using TapSuppressionController::NOTHING;
19 using TapSuppressionController::GFC_IN_PROGRESS;
20 using TapSuppressionController::TAP_DOWN_STASHED;
21 using TapSuppressionController::LAST_CANCEL_STOPPED_FLING;
23 enum Action {
24 NONE = 0,
25 TAP_DOWN_DEFERRED = 1 << 0,
26 TAP_DOWN_FORWARDED = 1 << 1,
27 TAP_DOWN_DROPPED = 1 << 2,
28 TAP_UP_SUPPRESSED = 1 << 3,
29 TAP_UP_FORWARDED = 1 << 4,
30 TAP_CANCEL_SUPPRESSED = 1 << 5,
31 TAP_CANCEL_FORWARDED = 1 << 6,
32 STASHED_TAP_DOWN_FORWARDED = 1 << 7,
35 MockTapSuppressionController()
36 : TapSuppressionController(this),
37 max_cancel_to_down_time_in_ms_(1),
38 max_tap_gap_time_in_ms_(1),
39 last_actions_(NONE),
40 time_(),
41 timer_started_(false) {
44 virtual ~MockTapSuppressionController() {}
46 void SendGestureFlingCancel() {
47 last_actions_ = NONE;
48 GestureFlingCancel();
51 void SendGestureFlingCancelAck(bool processed) {
52 last_actions_ = NONE;
53 GestureFlingCancelAck(processed);
56 void SendTapDown() {
57 last_actions_ = NONE;
58 if (ShouldDeferTapDown())
59 last_actions_ |= TAP_DOWN_DEFERRED;
60 else
61 last_actions_ |= TAP_DOWN_FORWARDED;
64 void SendTapUp() {
65 last_actions_ = NONE;
66 if (ShouldSuppressTapEnd())
67 last_actions_ |= TAP_UP_SUPPRESSED;
68 else
69 last_actions_ |= TAP_UP_FORWARDED;
72 void SendTapCancel() {
73 last_actions_ = NONE;
74 if (ShouldSuppressTapEnd())
75 last_actions_ |= TAP_CANCEL_SUPPRESSED;
76 else
77 last_actions_ |= TAP_CANCEL_FORWARDED;
80 void AdvanceTime(const base::TimeDelta& delta) {
81 last_actions_ = NONE;
82 time_ += delta;
83 if (timer_started_ && time_ >= timer_expiry_time_) {
84 timer_started_ = false;
85 TapDownTimerExpired();
89 void set_max_cancel_to_down_time_in_ms(int val) {
90 max_cancel_to_down_time_in_ms_ = val;
93 void set_max_tap_gap_time_in_ms(int val) {
94 max_tap_gap_time_in_ms_ = val;
97 State state() { return state_; }
99 int last_actions() { return last_actions_; }
101 protected:
102 virtual base::TimeTicks Now() OVERRIDE {
103 return time_;
106 virtual void StartTapDownTimer(const base::TimeDelta& delay) OVERRIDE {
107 timer_expiry_time_ = time_ + delay;
108 timer_started_ = true;
111 virtual void StopTapDownTimer() OVERRIDE {
112 timer_started_ = false;
115 private:
116 // TapSuppressionControllerClient implementation
117 virtual int MaxCancelToDownTimeInMs() OVERRIDE {
118 return max_cancel_to_down_time_in_ms_;
121 virtual int MaxTapGapTimeInMs() OVERRIDE {
122 return max_tap_gap_time_in_ms_;
125 virtual void DropStashedTapDown() OVERRIDE {
126 last_actions_ |= TAP_DOWN_DROPPED;
129 virtual void ForwardStashedTapDown() OVERRIDE {
130 last_actions_ |= STASHED_TAP_DOWN_FORWARDED;
133 // Hiding some derived public methods
134 using TapSuppressionController::GestureFlingCancel;
135 using TapSuppressionController::GestureFlingCancelAck;
136 using TapSuppressionController::ShouldDeferTapDown;
137 using TapSuppressionController::ShouldSuppressTapEnd;
139 int max_cancel_to_down_time_in_ms_;
140 int max_tap_gap_time_in_ms_;
142 int last_actions_;
144 base::TimeTicks time_;
145 bool timer_started_;
146 base::TimeTicks timer_expiry_time_;
148 DISALLOW_COPY_AND_ASSIGN(MockTapSuppressionController);
151 class TapSuppressionControllerTest : public testing::Test {
152 public:
153 TapSuppressionControllerTest() {
155 virtual ~TapSuppressionControllerTest() {
158 protected:
159 // testing::Test
160 virtual void SetUp() {
161 tap_suppression_controller_.reset(new MockTapSuppressionController());
164 virtual void TearDown() {
165 tap_suppression_controller_.reset();
168 scoped_ptr<MockTapSuppressionController> tap_suppression_controller_;
171 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
172 // TapDown and everything happens without any delays.
173 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapFast) {
174 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
175 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
177 // Send GestureFlingCancel.
178 tap_suppression_controller_->SendGestureFlingCancel();
179 EXPECT_EQ(MockTapSuppressionController::NONE,
180 tap_suppression_controller_->last_actions());
181 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
182 tap_suppression_controller_->state());
184 // Send GestureFlingCancel Ack.
185 tap_suppression_controller_->SendGestureFlingCancelAck(true);
186 EXPECT_EQ(MockTapSuppressionController::NONE,
187 tap_suppression_controller_->last_actions());
188 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
189 tap_suppression_controller_->state());
191 // Send TapDown. This TapDown should be suppressed.
192 tap_suppression_controller_->SendTapDown();
193 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
194 tap_suppression_controller_->last_actions());
195 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
196 tap_suppression_controller_->state());
198 // Send TapUp. This TapUp should be suppressed.
199 tap_suppression_controller_->SendTapUp();
200 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
201 MockTapSuppressionController::TAP_DOWN_DROPPED,
202 tap_suppression_controller_->last_actions());
203 EXPECT_EQ(MockTapSuppressionController::NOTHING,
204 tap_suppression_controller_->state());
207 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
208 // TapDown, but there is a small delay between TapDown and TapUp.
209 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapInsufficientlyLateTapUp) {
210 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
211 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
213 // Send GestureFlingCancel.
214 tap_suppression_controller_->SendGestureFlingCancel();
215 EXPECT_EQ(MockTapSuppressionController::NONE,
216 tap_suppression_controller_->last_actions());
217 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
218 tap_suppression_controller_->state());
220 // Send GestureFlingCancel Ack.
221 tap_suppression_controller_->SendGestureFlingCancelAck(true);
222 EXPECT_EQ(MockTapSuppressionController::NONE,
223 tap_suppression_controller_->last_actions());
224 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
225 tap_suppression_controller_->state());
227 // Send TapDown. This TapDown should be suppressed.
228 tap_suppression_controller_->SendTapDown();
229 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
230 tap_suppression_controller_->last_actions());
231 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
232 tap_suppression_controller_->state());
234 // Wait less than allowed delay between TapDown and TapUp, so they are still
235 // considered a tap.
236 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(7));
237 EXPECT_EQ(MockTapSuppressionController::NONE,
238 tap_suppression_controller_->last_actions());
239 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
240 tap_suppression_controller_->state());
242 // Send TapUp. This TapUp should be suppressed.
243 tap_suppression_controller_->SendTapUp();
244 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
245 MockTapSuppressionController::TAP_DOWN_DROPPED,
246 tap_suppression_controller_->last_actions());
247 EXPECT_EQ(MockTapSuppressionController::NOTHING,
248 tap_suppression_controller_->state());
251 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
252 // TapDown, but there is a long delay between TapDown and TapUp.
253 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapSufficientlyLateTapUp) {
254 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
255 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
257 // Send GestureFlingCancel.
258 tap_suppression_controller_->SendGestureFlingCancel();
259 EXPECT_EQ(MockTapSuppressionController::NONE,
260 tap_suppression_controller_->last_actions());
261 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
262 tap_suppression_controller_->state());
264 // Send processed GestureFlingCancel Ack.
265 tap_suppression_controller_->SendGestureFlingCancelAck(true);
266 EXPECT_EQ(MockTapSuppressionController::NONE,
267 tap_suppression_controller_->last_actions());
268 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
269 tap_suppression_controller_->state());
271 // Send MouseDown. This MouseDown should be suppressed, for now.
272 tap_suppression_controller_->SendTapDown();
273 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
274 tap_suppression_controller_->last_actions());
275 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
276 tap_suppression_controller_->state());
278 // Wait more than allowed delay between TapDown and TapUp, so they are not
279 // considered a tap. This should release the previously suppressed TapDown.
280 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(13));
281 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED,
282 tap_suppression_controller_->last_actions());
283 EXPECT_EQ(MockTapSuppressionController::NOTHING,
284 tap_suppression_controller_->state());
286 // Send TapUp. This TapUp should not be suppressed.
287 tap_suppression_controller_->SendTapUp();
288 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
289 tap_suppression_controller_->last_actions());
290 EXPECT_EQ(MockTapSuppressionController::NOTHING,
291 tap_suppression_controller_->state());
294 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
295 // TapDown, but there is a small delay between the Ack and TapDown.
296 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapInsufficientlyLateTapDown) {
297 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
298 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
300 // Send GestureFlingCancel.
301 tap_suppression_controller_->SendGestureFlingCancel();
302 EXPECT_EQ(MockTapSuppressionController::NONE,
303 tap_suppression_controller_->last_actions());
304 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
305 tap_suppression_controller_->state());
307 // Send GestureFlingCancel Ack.
308 tap_suppression_controller_->SendGestureFlingCancelAck(true);
309 EXPECT_EQ(MockTapSuppressionController::NONE,
310 tap_suppression_controller_->last_actions());
311 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
312 tap_suppression_controller_->state());
314 // Wait less than allowed delay between GestureFlingCancel and TapDown, so the
315 // TapDown is still considered associated with the GestureFlingCancel.
316 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(7));
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 // Send TapDown. This TapDown should be suppressed.
323 tap_suppression_controller_->SendTapDown();
324 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
325 tap_suppression_controller_->last_actions());
326 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
327 tap_suppression_controller_->state());
329 // Send TapUp. This TapUp should be suppressed.
330 tap_suppression_controller_->SendTapUp();
331 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
332 MockTapSuppressionController::TAP_DOWN_DROPPED,
333 tap_suppression_controller_->last_actions());
334 EXPECT_EQ(MockTapSuppressionController::NOTHING,
335 tap_suppression_controller_->state());
338 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
339 // TapDown, but there is a long delay between the Ack and TapDown.
340 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapSufficientlyLateTapDown) {
341 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
342 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
344 // Send GestureFlingCancel.
345 tap_suppression_controller_->SendGestureFlingCancel();
346 EXPECT_EQ(MockTapSuppressionController::NONE,
347 tap_suppression_controller_->last_actions());
348 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
349 tap_suppression_controller_->state());
351 // Send GestureFlingCancel Ack.
352 tap_suppression_controller_->SendGestureFlingCancelAck(true);
353 EXPECT_EQ(MockTapSuppressionController::NONE,
354 tap_suppression_controller_->last_actions());
355 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
356 tap_suppression_controller_->state());
358 // Wait more than allowed delay between GestureFlingCancel and TapDown, so the
359 // TapDown is not considered associated with the GestureFlingCancel.
360 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(13));
361 EXPECT_EQ(MockTapSuppressionController::NONE,
362 tap_suppression_controller_->last_actions());
363 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
364 tap_suppression_controller_->state());
366 // Send TapDown. This TapDown should not be suppressed.
367 tap_suppression_controller_->SendTapDown();
368 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_FORWARDED,
369 tap_suppression_controller_->last_actions());
370 EXPECT_EQ(MockTapSuppressionController::NOTHING,
371 tap_suppression_controller_->state());
373 // Send MouseUp. This MouseUp should not be suppressed.
374 tap_suppression_controller_->SendTapUp();
375 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
376 tap_suppression_controller_->last_actions());
377 EXPECT_EQ(MockTapSuppressionController::NOTHING,
378 tap_suppression_controller_->state());
381 // Test TapSuppressionController for when unprocessed GestureFlingCancel Ack
382 // comes after TapDown and everything happens without any delay.
383 TEST_F(TapSuppressionControllerTest, GFCAckUnprocessedAfterTapFast) {
384 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
385 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
387 // Send GestureFlingCancel.
388 tap_suppression_controller_->SendGestureFlingCancel();
389 EXPECT_EQ(MockTapSuppressionController::NONE,
390 tap_suppression_controller_->last_actions());
391 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
392 tap_suppression_controller_->state());
394 // Send TapDown. This TapDown should be suppressed, for now.
395 tap_suppression_controller_->SendTapDown();
396 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
397 tap_suppression_controller_->last_actions());
398 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
399 tap_suppression_controller_->state());
401 // Send unprocessed GestureFlingCancel Ack. This should release the
402 // previously suppressed TapDown.
403 tap_suppression_controller_->SendGestureFlingCancelAck(false);
404 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED,
405 tap_suppression_controller_->last_actions());
406 EXPECT_EQ(MockTapSuppressionController::NOTHING,
407 tap_suppression_controller_->state());
409 // Send TapUp. This TapUp should not be suppressed.
410 tap_suppression_controller_->SendTapUp();
411 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
412 tap_suppression_controller_->last_actions());
413 EXPECT_EQ(MockTapSuppressionController::NOTHING,
414 tap_suppression_controller_->state());
417 // Test TapSuppressionController for when processed GestureFlingCancel Ack comes
418 // after TapDown and everything happens without any delay.
419 TEST_F(TapSuppressionControllerTest, GFCAckProcessedAfterTapFast) {
420 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
421 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
423 // Send GestureFlingCancel.
424 tap_suppression_controller_->SendGestureFlingCancel();
425 EXPECT_EQ(MockTapSuppressionController::NONE,
426 tap_suppression_controller_->last_actions());
427 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
428 tap_suppression_controller_->state());
430 // Send TapDown. This TapDown should be suppressed.
431 tap_suppression_controller_->SendTapDown();
432 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
433 tap_suppression_controller_->last_actions());
434 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
435 tap_suppression_controller_->state());
437 // Send processed GestureFlingCancel Ack.
438 tap_suppression_controller_->SendGestureFlingCancelAck(true);
439 EXPECT_EQ(MockTapSuppressionController::NONE,
440 tap_suppression_controller_->last_actions());
441 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
442 tap_suppression_controller_->state());
444 // Send TapUp. This TapUp should be suppressed.
445 tap_suppression_controller_->SendTapUp();
446 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
447 MockTapSuppressionController::TAP_DOWN_DROPPED,
448 tap_suppression_controller_->last_actions());
449 EXPECT_EQ(MockTapSuppressionController::NOTHING,
450 tap_suppression_controller_->state());
453 // Test TapSuppressionController for when GestureFlingCancel Ack comes after
454 // TapDown and there is a small delay between the Ack and TapUp.
455 TEST_F(TapSuppressionControllerTest, GFCAckAfterTapInsufficientlyLateTapUp) {
456 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
457 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
459 // Send GestureFlingCancel.
460 tap_suppression_controller_->SendGestureFlingCancel();
461 EXPECT_EQ(MockTapSuppressionController::NONE,
462 tap_suppression_controller_->last_actions());
463 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
464 tap_suppression_controller_->state());
466 // Send TapDown. This TapDown should be suppressed.
467 tap_suppression_controller_->SendTapDown();
468 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
469 tap_suppression_controller_->last_actions());
470 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
471 tap_suppression_controller_->state());
473 // Send GestureFlingCancel Ack.
474 tap_suppression_controller_->SendGestureFlingCancelAck(true);
475 EXPECT_EQ(MockTapSuppressionController::NONE,
476 tap_suppression_controller_->last_actions());
477 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
478 tap_suppression_controller_->state());
480 // Wait less than allowed delay between TapDown and TapUp, so they are still
481 // considered as a tap.
482 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(7));
483 EXPECT_EQ(MockTapSuppressionController::NONE,
484 tap_suppression_controller_->last_actions());
485 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
486 tap_suppression_controller_->state());
488 // Send TapUp. This TapUp should be suppressed.
489 tap_suppression_controller_->SendTapUp();
490 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
491 MockTapSuppressionController::TAP_DOWN_DROPPED,
492 tap_suppression_controller_->last_actions());
493 EXPECT_EQ(MockTapSuppressionController::NOTHING,
494 tap_suppression_controller_->state());
497 // Test TapSuppressionController for when GestureFlingCancel Ack comes after
498 // TapDown and there is a long delay between the Ack and TapUp.
499 TEST_F(TapSuppressionControllerTest, GFCAckAfterTapSufficientlyLateTapUp) {
500 tap_suppression_controller_->set_max_cancel_to_down_time_in_ms(10);
501 tap_suppression_controller_->set_max_tap_gap_time_in_ms(10);
503 // Send GestureFlingCancel.
504 tap_suppression_controller_->SendGestureFlingCancel();
505 EXPECT_EQ(MockTapSuppressionController::NONE,
506 tap_suppression_controller_->last_actions());
507 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
508 tap_suppression_controller_->state());
510 // Send TapDown. This TapDown should be suppressed, for now.
511 tap_suppression_controller_->SendTapDown();
512 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
513 tap_suppression_controller_->last_actions());
514 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
515 tap_suppression_controller_->state());
517 // Send GestureFlingCancel Ack.
518 tap_suppression_controller_->SendGestureFlingCancelAck(true);
519 EXPECT_EQ(MockTapSuppressionController::NONE,
520 tap_suppression_controller_->last_actions());
521 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
522 tap_suppression_controller_->state());
524 // Wait more than allowed delay between TapDown and TapUp, so they are not
525 // considered as a tap. This should release the previously suppressed TapDown.
526 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(13));
527 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED,
528 tap_suppression_controller_->last_actions());
529 EXPECT_EQ(MockTapSuppressionController::NOTHING,
530 tap_suppression_controller_->state());
532 // Send TapUp. This TapUp should not be suppressed.
533 tap_suppression_controller_->SendTapUp();
534 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
535 tap_suppression_controller_->last_actions());
536 EXPECT_EQ(MockTapSuppressionController::NOTHING,
537 tap_suppression_controller_->state());
540 } // namespace content