#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h"
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/webui_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/browser/bookmark_utils.h"
#include "components/bookmarks/browser/url_and_title.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/security_interstitials/content/security_interstitial_tab_helper.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/prerender_test_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/base/dragdrop/mojom/drag_drop_types.mojom-shared.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/image/image_skia.h"
BookmarkModel;
BookmarkNode;
UrlAndTitle;
namespace {
const char kPersistBookmarkURL[] = …;
const char16_t kPersistBookmarkTitle[] = …;
const base::Time kPersistLastUsedTime = …;
bool IsShowingInterstitial(content::WebContents* tab) { … }
}
class TestBookmarkTabHelperObserver : public BookmarkTabHelperObserver { … };
class BookmarkBrowsertest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, BookmarkBarVisibleWait) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, PRE_Persist) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_Persist …
#else
#define MAYBE_Persist …
#endif
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MAYBE_Persist) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, MultiProfile) { … }
#endif
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, IncognitoPersistence) { … }
IN_PROC_BROWSER_TEST_F(
BookmarkBrowsertest,
OpenFolderAsGroupInIncognitoWhenBookmarksCantOpenInIncognito) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, OpenAllBookmarks) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest,
HideStarOnNonbookmarkedInterstitial) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, DragSingleBookmark) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, FaviconChangeDuringBookmarkDrag) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, DragMultipleBookmarks) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, PRE_EmitUmaForTimeMetrics) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, EmitUmaForTimeMetrics) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, PRE_EmitUmaForMostRecentlyUsed) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, EmitUmaForMostRecentlyUsed) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest,
EmitUmaForMostRecentlyUsed_NoBookmarks) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, SameDocumentNavigation) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest,
DifferentDocumentNavigationWithoutFinishing) { … }
IN_PROC_BROWSER_TEST_F(BookmarkBrowsertest, NonCommitURLNavigation) { … }
class BookmarkPrerenderBrowsertest : public BookmarkBrowsertest { … };
IN_PROC_BROWSER_TEST_F(BookmarkPrerenderBrowsertest,
PrerenderingShouldNotUpdateStarredState) { … }