chromium/content/browser/preloading/anchor_element_interaction_browsertest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <string_view>

#include "base/run_loop.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "components/input/render_widget_host_input_event_router.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.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/public/test/test_navigation_observer.h"
#include "content/shell/browser/shell.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/synthetic_web_input_event_builders.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"

namespace content {
namespace {

class AnchorElementInteractionBrowserTest : public ContentBrowserTest {};

struct TestScriptOptions {};

std::string MakeTestScript(const TestScriptOptions& options = {}

// End-to-end test that document rules can cause prefetch on mouse down.
IN_PROC_BROWSER_TEST_F(AnchorElementInteractionBrowserTest, MouseDownPrefetch) {}

// End-to-end test that document rules can cause prefetch on mouse hover.
IN_PROC_BROWSER_TEST_F(AnchorElementInteractionBrowserTest,
                       MouseHoverPrefetch) {}

// Touch events are not supported on macOS.
#if !BUILDFLAG(IS_MAC)

// End-to-end test that document rules can cause prefetch on touch down.
IN_PROC_BROWSER_TEST_F(AnchorElementInteractionBrowserTest, TouchDownPrefetch) {}

#endif  // !BUILDFLAG(IS_MAC)

}  // namespace
}  // namespace content