Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / renderer_host / input / tap_suppression_controller_unittest.cc
blob702dc6f10b84bc15475e64f6d5ca37d9b1c1354e
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::DISABLED;
19 using TapSuppressionController::NOTHING;
20 using TapSuppressionController::GFC_IN_PROGRESS;
21 using TapSuppressionController::TAP_DOWN_STASHED;
22 using TapSuppressionController::LAST_CANCEL_STOPPED_FLING;
24 enum Action {
25 NONE = 0,
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),
38 last_actions_(NONE),
39 time_(),
40 timer_started_(false) {}
42 virtual ~MockTapSuppressionController() {}
44 void SendGestureFlingCancel() {
45 last_actions_ = NONE;
46 GestureFlingCancel();
49 void SendGestureFlingCancelAck(bool processed) {
50 last_actions_ = NONE;
51 GestureFlingCancelAck(processed);
54 void SendTapDown() {
55 last_actions_ = NONE;
56 if (ShouldDeferTapDown())
57 last_actions_ |= TAP_DOWN_DEFERRED;
58 else
59 last_actions_ |= TAP_DOWN_FORWARDED;
62 void SendTapUp() {
63 last_actions_ = NONE;
64 if (ShouldSuppressTapEnd())
65 last_actions_ |= TAP_UP_SUPPRESSED;
66 else
67 last_actions_ |= TAP_UP_FORWARDED;
70 void SendTapCancel() {
71 last_actions_ = NONE;
72 if (ShouldSuppressTapEnd())
73 last_actions_ |= TAP_CANCEL_SUPPRESSED;
74 else
75 last_actions_ |= TAP_CANCEL_FORWARDED;
78 void AdvanceTime(const base::TimeDelta& delta) {
79 last_actions_ = NONE;
80 time_ += 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_; }
91 protected:
92 virtual base::TimeTicks Now() OVERRIDE {
93 return time_;
96 virtual void StartTapDownTimer(const base::TimeDelta& delay) OVERRIDE {
97 timer_expiry_time_ = time_ + delay;
98 timer_started_ = true;
101 virtual void StopTapDownTimer() OVERRIDE {
102 timer_started_ = false;
105 private:
106 // TapSuppressionControllerClient implementation
107 virtual void DropStashedTapDown() OVERRIDE {
108 last_actions_ |= TAP_DOWN_DROPPED;
111 virtual void ForwardStashedTapDown() OVERRIDE {
112 last_actions_ |= STASHED_TAP_DOWN_FORWARDED;
115 // Hiding some derived public methods
116 using TapSuppressionController::GestureFlingCancel;
117 using TapSuppressionController::GestureFlingCancelAck;
118 using TapSuppressionController::ShouldDeferTapDown;
119 using TapSuppressionController::ShouldSuppressTapEnd;
121 int last_actions_;
123 base::TimeTicks time_;
124 bool timer_started_;
125 base::TimeTicks timer_expiry_time_;
127 DISALLOW_COPY_AND_ASSIGN(MockTapSuppressionController);
130 class TapSuppressionControllerTest : public testing::Test {
131 public:
132 TapSuppressionControllerTest() {
134 virtual ~TapSuppressionControllerTest() {
137 protected:
138 // testing::Test
139 virtual void SetUp() {
140 tap_suppression_controller_.reset(
141 new MockTapSuppressionController(GetConfig()));
144 virtual void TearDown() {
145 tap_suppression_controller_.reset();
148 static TapSuppressionController::Config GetConfig() {
149 TapSuppressionController::Config config;
150 config.enabled = true;
151 config.max_cancel_to_down_time = base::TimeDelta::FromMilliseconds(10);
152 config.max_tap_gap_time = base::TimeDelta::FromMilliseconds(10);
153 return config;
156 scoped_ptr<MockTapSuppressionController> tap_suppression_controller_;
159 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
160 // TapDown and everything happens without any delays.
161 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapFast) {
162 // Send GestureFlingCancel.
163 tap_suppression_controller_->SendGestureFlingCancel();
164 EXPECT_EQ(MockTapSuppressionController::NONE,
165 tap_suppression_controller_->last_actions());
166 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
167 tap_suppression_controller_->state());
169 // Send GestureFlingCancel Ack.
170 tap_suppression_controller_->SendGestureFlingCancelAck(true);
171 EXPECT_EQ(MockTapSuppressionController::NONE,
172 tap_suppression_controller_->last_actions());
173 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
174 tap_suppression_controller_->state());
176 // Send TapDown. This TapDown should be suppressed.
177 tap_suppression_controller_->SendTapDown();
178 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
179 tap_suppression_controller_->last_actions());
180 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
181 tap_suppression_controller_->state());
183 // Send TapUp. This TapUp should be suppressed.
184 tap_suppression_controller_->SendTapUp();
185 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
186 MockTapSuppressionController::TAP_DOWN_DROPPED,
187 tap_suppression_controller_->last_actions());
188 EXPECT_EQ(MockTapSuppressionController::NOTHING,
189 tap_suppression_controller_->state());
192 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
193 // TapDown, but there is a small delay between TapDown and TapUp.
194 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapInsufficientlyLateTapUp) {
195 // Send GestureFlingCancel.
196 tap_suppression_controller_->SendGestureFlingCancel();
197 EXPECT_EQ(MockTapSuppressionController::NONE,
198 tap_suppression_controller_->last_actions());
199 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
200 tap_suppression_controller_->state());
202 // Send GestureFlingCancel Ack.
203 tap_suppression_controller_->SendGestureFlingCancelAck(true);
204 EXPECT_EQ(MockTapSuppressionController::NONE,
205 tap_suppression_controller_->last_actions());
206 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
207 tap_suppression_controller_->state());
209 // Send TapDown. This TapDown should be suppressed.
210 tap_suppression_controller_->SendTapDown();
211 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
212 tap_suppression_controller_->last_actions());
213 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
214 tap_suppression_controller_->state());
216 // Wait less than allowed delay between TapDown and TapUp, so they are still
217 // considered a tap.
218 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(7));
219 EXPECT_EQ(MockTapSuppressionController::NONE,
220 tap_suppression_controller_->last_actions());
221 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
222 tap_suppression_controller_->state());
224 // Send TapUp. This TapUp should be suppressed.
225 tap_suppression_controller_->SendTapUp();
226 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
227 MockTapSuppressionController::TAP_DOWN_DROPPED,
228 tap_suppression_controller_->last_actions());
229 EXPECT_EQ(MockTapSuppressionController::NOTHING,
230 tap_suppression_controller_->state());
233 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
234 // TapDown, but there is a long delay between TapDown and TapUp.
235 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapSufficientlyLateTapUp) {
236 // Send GestureFlingCancel.
237 tap_suppression_controller_->SendGestureFlingCancel();
238 EXPECT_EQ(MockTapSuppressionController::NONE,
239 tap_suppression_controller_->last_actions());
240 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
241 tap_suppression_controller_->state());
243 // Send processed GestureFlingCancel Ack.
244 tap_suppression_controller_->SendGestureFlingCancelAck(true);
245 EXPECT_EQ(MockTapSuppressionController::NONE,
246 tap_suppression_controller_->last_actions());
247 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
248 tap_suppression_controller_->state());
250 // Send MouseDown. This MouseDown should be suppressed, for now.
251 tap_suppression_controller_->SendTapDown();
252 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
253 tap_suppression_controller_->last_actions());
254 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
255 tap_suppression_controller_->state());
257 // Wait more than allowed delay between TapDown and TapUp, so they are not
258 // considered a tap. This should release the previously suppressed TapDown.
259 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(13));
260 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED,
261 tap_suppression_controller_->last_actions());
262 EXPECT_EQ(MockTapSuppressionController::NOTHING,
263 tap_suppression_controller_->state());
265 // Send TapUp. This TapUp should not be suppressed.
266 tap_suppression_controller_->SendTapUp();
267 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
268 tap_suppression_controller_->last_actions());
269 EXPECT_EQ(MockTapSuppressionController::NOTHING,
270 tap_suppression_controller_->state());
273 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
274 // TapDown, but there is a small delay between the Ack and TapDown.
275 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapInsufficientlyLateTapDown) {
276 // Send GestureFlingCancel.
277 tap_suppression_controller_->SendGestureFlingCancel();
278 EXPECT_EQ(MockTapSuppressionController::NONE,
279 tap_suppression_controller_->last_actions());
280 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
281 tap_suppression_controller_->state());
283 // Send GestureFlingCancel Ack.
284 tap_suppression_controller_->SendGestureFlingCancelAck(true);
285 EXPECT_EQ(MockTapSuppressionController::NONE,
286 tap_suppression_controller_->last_actions());
287 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
288 tap_suppression_controller_->state());
290 // Wait less than allowed delay between GestureFlingCancel and TapDown, so the
291 // TapDown is still considered associated with the GestureFlingCancel.
292 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(7));
293 EXPECT_EQ(MockTapSuppressionController::NONE,
294 tap_suppression_controller_->last_actions());
295 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
296 tap_suppression_controller_->state());
298 // Send TapDown. This TapDown should be suppressed.
299 tap_suppression_controller_->SendTapDown();
300 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
301 tap_suppression_controller_->last_actions());
302 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
303 tap_suppression_controller_->state());
305 // Send TapUp. This TapUp should be suppressed.
306 tap_suppression_controller_->SendTapUp();
307 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
308 MockTapSuppressionController::TAP_DOWN_DROPPED,
309 tap_suppression_controller_->last_actions());
310 EXPECT_EQ(MockTapSuppressionController::NOTHING,
311 tap_suppression_controller_->state());
314 // Test TapSuppressionController for when GestureFlingCancel Ack comes before
315 // TapDown, but there is a long delay between the Ack and TapDown.
316 TEST_F(TapSuppressionControllerTest, GFCAckBeforeTapSufficientlyLateTapDown) {
317 // Send GestureFlingCancel.
318 tap_suppression_controller_->SendGestureFlingCancel();
319 EXPECT_EQ(MockTapSuppressionController::NONE,
320 tap_suppression_controller_->last_actions());
321 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
322 tap_suppression_controller_->state());
324 // Send GestureFlingCancel Ack.
325 tap_suppression_controller_->SendGestureFlingCancelAck(true);
326 EXPECT_EQ(MockTapSuppressionController::NONE,
327 tap_suppression_controller_->last_actions());
328 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
329 tap_suppression_controller_->state());
331 // Wait more than allowed delay between GestureFlingCancel and TapDown, so the
332 // TapDown is not considered associated with the GestureFlingCancel.
333 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(13));
334 EXPECT_EQ(MockTapSuppressionController::NONE,
335 tap_suppression_controller_->last_actions());
336 EXPECT_EQ(MockTapSuppressionController::LAST_CANCEL_STOPPED_FLING,
337 tap_suppression_controller_->state());
339 // Send TapDown. This TapDown should not be suppressed.
340 tap_suppression_controller_->SendTapDown();
341 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_FORWARDED,
342 tap_suppression_controller_->last_actions());
343 EXPECT_EQ(MockTapSuppressionController::NOTHING,
344 tap_suppression_controller_->state());
346 // Send MouseUp. This MouseUp should not be suppressed.
347 tap_suppression_controller_->SendTapUp();
348 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
349 tap_suppression_controller_->last_actions());
350 EXPECT_EQ(MockTapSuppressionController::NOTHING,
351 tap_suppression_controller_->state());
354 // Test TapSuppressionController for when unprocessed GestureFlingCancel Ack
355 // comes after TapDown and everything happens without any delay.
356 TEST_F(TapSuppressionControllerTest, GFCAckUnprocessedAfterTapFast) {
357 // Send GestureFlingCancel.
358 tap_suppression_controller_->SendGestureFlingCancel();
359 EXPECT_EQ(MockTapSuppressionController::NONE,
360 tap_suppression_controller_->last_actions());
361 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
362 tap_suppression_controller_->state());
364 // Send TapDown. This TapDown should be suppressed, for now.
365 tap_suppression_controller_->SendTapDown();
366 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
367 tap_suppression_controller_->last_actions());
368 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
369 tap_suppression_controller_->state());
371 // Send unprocessed GestureFlingCancel Ack. This should release the
372 // previously suppressed TapDown.
373 tap_suppression_controller_->SendGestureFlingCancelAck(false);
374 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED,
375 tap_suppression_controller_->last_actions());
376 EXPECT_EQ(MockTapSuppressionController::NOTHING,
377 tap_suppression_controller_->state());
379 // Send TapUp. This TapUp should not be suppressed.
380 tap_suppression_controller_->SendTapUp();
381 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
382 tap_suppression_controller_->last_actions());
383 EXPECT_EQ(MockTapSuppressionController::NOTHING,
384 tap_suppression_controller_->state());
387 // Test TapSuppressionController for when processed GestureFlingCancel Ack comes
388 // after TapDown and everything happens without any delay.
389 TEST_F(TapSuppressionControllerTest, GFCAckProcessedAfterTapFast) {
390 // Send GestureFlingCancel.
391 tap_suppression_controller_->SendGestureFlingCancel();
392 EXPECT_EQ(MockTapSuppressionController::NONE,
393 tap_suppression_controller_->last_actions());
394 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
395 tap_suppression_controller_->state());
397 // Send TapDown. This TapDown should be suppressed.
398 tap_suppression_controller_->SendTapDown();
399 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
400 tap_suppression_controller_->last_actions());
401 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
402 tap_suppression_controller_->state());
404 // Send processed GestureFlingCancel Ack.
405 tap_suppression_controller_->SendGestureFlingCancelAck(true);
406 EXPECT_EQ(MockTapSuppressionController::NONE,
407 tap_suppression_controller_->last_actions());
408 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
409 tap_suppression_controller_->state());
411 // Send TapUp. This TapUp should be suppressed.
412 tap_suppression_controller_->SendTapUp();
413 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
414 MockTapSuppressionController::TAP_DOWN_DROPPED,
415 tap_suppression_controller_->last_actions());
416 EXPECT_EQ(MockTapSuppressionController::NOTHING,
417 tap_suppression_controller_->state());
420 // Test TapSuppressionController for when GestureFlingCancel Ack comes after
421 // TapDown and there is a small delay between the Ack and TapUp.
422 TEST_F(TapSuppressionControllerTest, GFCAckAfterTapInsufficientlyLateTapUp) {
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 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 // Wait less than allowed delay between TapDown and TapUp, so they are still
445 // considered as a tap.
446 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(7));
447 EXPECT_EQ(MockTapSuppressionController::NONE,
448 tap_suppression_controller_->last_actions());
449 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
450 tap_suppression_controller_->state());
452 // Send TapUp. This TapUp should be suppressed.
453 tap_suppression_controller_->SendTapUp();
454 EXPECT_EQ(MockTapSuppressionController::TAP_UP_SUPPRESSED |
455 MockTapSuppressionController::TAP_DOWN_DROPPED,
456 tap_suppression_controller_->last_actions());
457 EXPECT_EQ(MockTapSuppressionController::NOTHING,
458 tap_suppression_controller_->state());
461 // Test TapSuppressionController for when GestureFlingCancel Ack comes after
462 // TapDown and there is a long delay between the Ack and TapUp.
463 TEST_F(TapSuppressionControllerTest, GFCAckAfterTapSufficientlyLateTapUp) {
464 // Send GestureFlingCancel.
465 tap_suppression_controller_->SendGestureFlingCancel();
466 EXPECT_EQ(MockTapSuppressionController::NONE,
467 tap_suppression_controller_->last_actions());
468 EXPECT_EQ(MockTapSuppressionController::GFC_IN_PROGRESS,
469 tap_suppression_controller_->state());
471 // Send TapDown. This TapDown should be suppressed, for now.
472 tap_suppression_controller_->SendTapDown();
473 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_DEFERRED,
474 tap_suppression_controller_->last_actions());
475 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
476 tap_suppression_controller_->state());
478 // Send GestureFlingCancel Ack.
479 tap_suppression_controller_->SendGestureFlingCancelAck(true);
480 EXPECT_EQ(MockTapSuppressionController::NONE,
481 tap_suppression_controller_->last_actions());
482 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_STASHED,
483 tap_suppression_controller_->state());
485 // Wait more than allowed delay between TapDown and TapUp, so they are not
486 // considered as a tap. This should release the previously suppressed TapDown.
487 tap_suppression_controller_->AdvanceTime(TimeDelta::FromMilliseconds(13));
488 EXPECT_EQ(MockTapSuppressionController::STASHED_TAP_DOWN_FORWARDED,
489 tap_suppression_controller_->last_actions());
490 EXPECT_EQ(MockTapSuppressionController::NOTHING,
491 tap_suppression_controller_->state());
493 // Send TapUp. This TapUp should not be suppressed.
494 tap_suppression_controller_->SendTapUp();
495 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
496 tap_suppression_controller_->last_actions());
497 EXPECT_EQ(MockTapSuppressionController::NOTHING,
498 tap_suppression_controller_->state());
501 // Test that no suppression occurs if the TapSuppressionController is disabled.
502 TEST_F(TapSuppressionControllerTest, NoSuppressionIfDisabled) {
503 TapSuppressionController::Config disabled_config;
504 disabled_config.enabled = false;
505 tap_suppression_controller_.reset(
506 new MockTapSuppressionController(disabled_config));
508 // Send GestureFlingCancel.
509 tap_suppression_controller_->SendGestureFlingCancel();
510 EXPECT_EQ(MockTapSuppressionController::NONE,
511 tap_suppression_controller_->last_actions());
512 EXPECT_EQ(MockTapSuppressionController::DISABLED,
513 tap_suppression_controller_->state());
515 // Send GestureFlingCancel Ack.
516 tap_suppression_controller_->SendGestureFlingCancelAck(true);
517 EXPECT_EQ(MockTapSuppressionController::NONE,
518 tap_suppression_controller_->last_actions());
519 EXPECT_EQ(MockTapSuppressionController::DISABLED,
520 tap_suppression_controller_->state());
522 // Send TapDown. This TapDown should not be suppressed.
523 tap_suppression_controller_->SendTapDown();
524 EXPECT_EQ(MockTapSuppressionController::TAP_DOWN_FORWARDED,
525 tap_suppression_controller_->last_actions());
526 EXPECT_EQ(MockTapSuppressionController::DISABLED,
527 tap_suppression_controller_->state());
529 // Send TapUp. This TapUp should not be suppressed.
530 tap_suppression_controller_->SendTapUp();
531 EXPECT_EQ(MockTapSuppressionController::TAP_UP_FORWARDED,
532 tap_suppression_controller_->last_actions());
533 EXPECT_EQ(MockTapSuppressionController::DISABLED,
534 tap_suppression_controller_->state());
537 } // namespace content