Commit f505e5d5 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Use base::DoNothing to make QueueSyntheticGesture calls even more concise.

In response to https://chromium-review.googlesource.com/c/chromium/src/+/1943108.

Change-Id: I06e99b465b52aa6710d6f747277c375b86be5b24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1943334
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Auto-Submit: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720211}
parent f67faf18
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <memory> #include <memory>
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
...@@ -572,8 +573,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchAckAfterActivate) { ...@@ -572,8 +573,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchAckAfterActivate) {
PortalActivatedObserver activated_observer(portal); PortalActivatedObserver activated_observer(portal);
std::unique_ptr<SyntheticTapGesture> gesture = std::unique_ptr<SyntheticTapGesture> gesture =
std::make_unique<SyntheticTapGesture>(params); std::make_unique<SyntheticTapGesture>(params);
render_widget_host->QueueSyntheticGesture( render_widget_host->QueueSyntheticGesture(std::move(gesture),
std::move(gesture), base::BindOnce([](SyntheticGesture::Result) {})); base::DoNothing());
activated_observer.WaitForActivate(); activated_observer.WaitForActivate();
EXPECT_EQ(portal_contents, shell()->web_contents()); EXPECT_EQ(portal_contents, shell()->web_contents());
...@@ -627,8 +628,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchAckAfterActivateAndAdopt) { ...@@ -627,8 +628,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchAckAfterActivateAndAdopt) {
{ {
PortalActivatedObserver activated_observer(portal); PortalActivatedObserver activated_observer(portal);
PortalCreatedObserver adoption_observer(portal_frame); PortalCreatedObserver adoption_observer(portal_frame);
render_widget_host->QueueSyntheticGesture( render_widget_host->QueueSyntheticGesture(std::move(gesture),
std::move(gesture), base::BindOnce([](SyntheticGesture::Result) {})); base::DoNothing());
activated_observer.WaitForActivate(); activated_observer.WaitForActivate();
EXPECT_EQ(portal_contents, shell()->web_contents()); EXPECT_EQ(portal_contents, shell()->web_contents());
// Wait for predecessor to be adopted. // Wait for predecessor to be adopted.
...@@ -688,8 +689,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchAckAfterActivateAndReactivate) { ...@@ -688,8 +689,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchAckAfterActivateAndReactivate) {
[&](Portal* portal) { predecessor_activated.emplace(portal); })); [&](Portal* portal) { predecessor_activated.emplace(portal); }));
PortalActivatedObserver activated_observer(portal); PortalActivatedObserver activated_observer(portal);
render_widget_host->QueueSyntheticGesture( render_widget_host->QueueSyntheticGesture(std::move(gesture),
std::move(gesture), base::BindOnce([](SyntheticGesture::Result) {})); base::DoNothing());
activated_observer.WaitForActivate(); activated_observer.WaitForActivate();
EXPECT_EQ(portal_contents, shell()->web_contents()); EXPECT_EQ(portal_contents, shell()->web_contents());
...@@ -766,8 +767,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchStateClearedBeforeActivation) { ...@@ -766,8 +767,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchStateClearedBeforeActivation) {
render_widget_host, blink::WebInputEvent::Type::kTouchStart); render_widget_host, blink::WebInputEvent::Type::kTouchStart);
std::unique_ptr<SyntheticTapGesture> gesture = std::unique_ptr<SyntheticTapGesture> gesture =
std::make_unique<SyntheticTapGesture>(params); std::make_unique<SyntheticTapGesture>(params);
render_widget_host->QueueSyntheticGesture( render_widget_host->QueueSyntheticGesture(std::move(gesture),
std::move(gesture), base::BindOnce([](SyntheticGesture::Result) {})); base::DoNothing());
// Waits for touch to be acked. If touch state wasn't cleared before initial // Waits for touch to be acked. If touch state wasn't cleared before initial
// activation, a DCHECK will be hit before the ack is sent. // activation, a DCHECK will be hit before the ack is sent.
input_event_ack_waiter.Wait(); input_event_ack_waiter.Wait();
...@@ -833,8 +834,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, GestureCleanedUpBeforeActivation) { ...@@ -833,8 +834,8 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, GestureCleanedUpBeforeActivation) {
InputEventAckWaiter input_event_ack_waiter( InputEventAckWaiter input_event_ack_waiter(
render_widget_host, blink::WebInputEvent::Type::kGestureTap); render_widget_host, blink::WebInputEvent::Type::kGestureTap);
auto gesture = std::make_unique<SyntheticTapGesture>(params); auto gesture = std::make_unique<SyntheticTapGesture>(params);
render_widget_host->QueueSyntheticGesture( render_widget_host->QueueSyntheticGesture(std::move(gesture),
std::move(gesture), base::BindOnce([](SyntheticGesture::Result) {})); base::DoNothing());
// Wait for the tap gesture ack. If the initial gesture wasn't cleaned up, the // Wait for the tap gesture ack. If the initial gesture wasn't cleaned up, the
// new gesture created will cause an error in the gesture validator. // new gesture created will cause an error in the gesture validator.
input_event_ack_waiter.Wait(); input_event_ack_waiter.Wait();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment