#include "base/task/single_thread_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/back_forward_cache_util.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/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "third_party/blink/public/common/switches.h"
#include "url/gurl.h"
#define EXPECT_DID_SCROLL(scrolled) …
#define ASSERT_DID_SCROLL(scrolled) …
namespace content {
class TextFragmentAnchorBrowserTest : public ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest, EnabledOnUserNavigation) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
EnabledOnBrowserNavigation) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
EnabledOnUserGestureScriptNavigation) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
UserGesturePassedThroughRedirect) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest, UserGestureConsumed) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
DisabledOnScriptHistoryNavigation) { … }
#if BUILDFLAG(IS_CHROMEOS) && !defined(NDEBUG)
#define MAYBE_SameDocumentBrowserNavigation …
#else
#define MAYBE_SameDocumentBrowserNavigation …
#endif
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
MAYBE_SameDocumentBrowserNavigation) { … }
#if BUILDFLAG(IS_CHROMEOS) && !defined(NDEBUG)
#define MAYBE_SameDocumentBrowserNavigationOnScriptNavigatedDocument …
#else
#define MAYBE_SameDocumentBrowserNavigationOnScriptNavigatedDocument …
#endif
IN_PROC_BROWSER_TEST_F(
TextFragmentAnchorBrowserTest,
MAYBE_SameDocumentBrowserNavigationOnScriptNavigatedDocument) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
HistoryDoesntGenerateToken) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
SameDocumentScriptNavigation) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
SameDocumentScriptNavigationSameOrigin) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
SameDocumentScriptNavigationCrossOrigin) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest, EnabledByDocumentPolicy) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
DisabledByDocumentPolicy) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest, TabFocus) { … }
class ForceLoadAtTopBrowserTest : public TextFragmentAnchorBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ForceLoadAtTopBrowserTest, ScrollRestorationDisabled) { … }
IN_PROC_BROWSER_TEST_F(ForceLoadAtTopBrowserTest, FragmentAnchorDisabled) { … }
IN_PROC_BROWSER_TEST_F(ForceLoadAtTopBrowserTest, SameDocumentNavigation) { … }
IN_PROC_BROWSER_TEST_F(ForceLoadAtTopBrowserTest, TextFragmentAnchorDisabled) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
LinkOpenSourceMetrics_GoogleClientRedirect) { … }
IN_PROC_BROWSER_TEST_F(TextFragmentAnchorBrowserTest,
LinkOpenSourceMetrics_GoogleServerRedirect) { … }
}