#include <tuple>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/input/render_widget_host_input_event_router.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/input/synthetic_smooth_scroll_gesture.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "net/dns/mock_host_resolver.h"
#include "third_party/blink/public/common/input/synthetic_web_input_event_builders.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/base_event_utils.h"
namespace {
const std::string kBrowserFlingDataURL = …;
const std::string kTouchActionFilterDataURL = …;
}
namespace content {
class BrowserSideFlingBrowserTest : public ContentBrowserTest { … };
#if !BUILDFLAG(IS_MAC)
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchscreenFling) { … }
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest, TouchpadFling) { … }
IN_PROC_BROWSER_TEST_F(
BrowserSideFlingBrowserTest,
EarlyTouchscreenFlingCancelationOnInertialGSUAckNotConsumed) { … }
IN_PROC_BROWSER_TEST_F(
BrowserSideFlingBrowserTest,
EarlyTouchpadFlingCancelationOnInertialGSUAckNotConsumed) { … }
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
DISABLED_FlingingStopsAfterNavigation) { … }
#if BUILDFLAG(IS_LINUX) && defined(MEMORY_SANITIZER)
#define MAYBE_TouchscreenFlingInOOPIF …
#else
#define MAYBE_TouchscreenFlingInOOPIF …
#endif
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
MAYBE_TouchscreenFlingInOOPIF) { … }
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
DISABLED_TouchpadFlingInOOPIF) { … }
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
DISABLED_TouchscreenInertialGSUsBubbleFromOOPIF) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
TouchpadInertialGSUsBubbleFromOOPIF) {
LoadPageWithOOPIF();
EXPECT_TRUE(
ExecJs(GetRootNode()->current_frame_host(), "window.scrollTo(0, 20)"));
WaitForFrameScroll(GetRootNode(), 19);
SynchronizeThreads();
gfx::Vector2d fling_velocity(0, 2000);
SimulateTouchpadFling(child_view_->host(), GetWidgetHost(), fling_velocity);
WaitForFrameScroll(GetRootNode(), 15, true );
}
#endif
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
DISABLED_InertialGSEGetsBubbledFromOOPIF) { … }
IN_PROC_BROWSER_TEST_F(
BrowserSideFlingBrowserTest,
DISABLED_InertialGSUBubblingStopsWhenParentCannotScroll) { … }
IN_PROC_BROWSER_TEST_F(BrowserSideFlingBrowserTest,
NoFlingWhenViewIsDestroyed) { … }
#endif
class PhysicsBasedFlingCurveBrowserTest : public BrowserSideFlingBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PhysicsBasedFlingCurveBrowserTest,
TargetScrollOffsetForFlingAnimation) { … }
}