#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include "chrome/browser/preloading/chrome_preloading.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tab_ui_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view_observer.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_bar_view_test_helper.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/page_load_metrics/browser/navigation_handle_user_data.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/navigation_handle_observer.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "services/network/public/cpp/features.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/test/test_event.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/test/button_test_api.h"
class BookmarkBarNavigationTest : public InProcessBrowserTest,
public content::WebContentsObserver { … };
IN_PROC_BROWSER_TEST_F(BookmarkBarNavigationTest, SecFetchFromEmptyTab) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
#define MAYBE_SecFetchSiteNoneFromNonEmptyTab …
#else
#define MAYBE_SecFetchSiteNoneFromNonEmptyTab …
#endif
IN_PROC_BROWSER_TEST_F(BookmarkBarNavigationTest,
MAYBE_SecFetchSiteNoneFromNonEmptyTab) { … }
class FakeProtocolHandlerDelegate : public ExternalProtocolHandler::Delegate { … };
IN_PROC_BROWSER_TEST_F(BookmarkBarNavigationTest, ExternalHandlerAllowed) { … }
UkmEntry;
Preloading_Attempt;
Preloading_Prediction;
static const auto kMockElapsedTime = …;
class PrerenderBookmarkBarNavigationTestBase
: public BookmarkBarNavigationTest { … };
constexpr int kFinalStatusActivated = …;
constexpr int kFinalStatusTriggerDestroyed = …;
constexpr int kPreloadingTriggeringOutcomeSuccess = …;
class PrerenderBookmarkBarOnPressedNavigationTest
: public PrerenderBookmarkBarNavigationTestBase { … };
class PrerenderBookmarkBarOnPressedNavigationTestNoTestingConfig
: public PrerenderBookmarkBarOnPressedNavigationTest { … };
IN_PROC_BROWSER_TEST_F(
PrerenderBookmarkBarOnPressedNavigationTestNoTestingConfig,
PrerenderActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBookmarkBarOnPressedNavigationTest,
PrerenderNonHttps) { … }
class PrerenderBookmarkBarOnHoverNavigationTest
: public PrerenderBookmarkBarNavigationTestBase { … };
IN_PROC_BROWSER_TEST_F(PrerenderBookmarkBarOnHoverNavigationTest,
PrerenderActivation) { … }
class PrerenderBookmarkBarOnHoverNavigationTestNoTestingConfig
: public PrerenderBookmarkBarOnHoverNavigationTest { … };
IN_PROC_BROWSER_TEST_F(
PrerenderBookmarkBarOnHoverNavigationTestNoTestingConfig,
DISABLED_PrerenderMouseExitedCancellationAndPrerenderActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBookmarkBarOnHoverNavigationTest,
SetIsNavigationInDomainCallback) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBookmarkBarOnHoverNavigationTest,
PrerenderNonHttps) { … }
class PrerenderBookmarkBarDisabledNavigationTest
: public PrerenderBookmarkBarNavigationTestBase { … };
IN_PROC_BROWSER_TEST_F(PrerenderBookmarkBarDisabledNavigationTest,
NonPrerenderingBookmarkBarNavigation) { … }