#include "chrome/browser/breadcrumbs/breadcrumb_manager_tab_helper.h"
#include <memory>
#include "base/containers/circular_deque.h"
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/breadcrumbs/core/breadcrumb_manager.h"
#include "components/breadcrumbs/core/breadcrumb_manager_tab_helper.h"
#include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobar_delegate.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_web_contents_factory.h"
#include "content/test/test_web_contents.h"
#include "testing/gtest/include/gtest/gtest.h"
InfoBarDelegate;
namespace {
class FakeInfoBarDelegate : public infobars::InfoBarDelegate { … };
std::unique_ptr<infobars::InfoBar> CreateInfoBar(
infobars::InfoBarDelegate::InfoBarIdentifier identifier) { … }
const base::circular_deque<std::string>& GetEvents() { … }
size_t GetNumEvents() { … }
}
class BreadcrumbManagerTabHelperTest : public ChromeRenderViewHostTestHarness { … };
TEST_F(BreadcrumbManagerTabHelperTest, UniqueIdentifiers) { … }
TEST_F(BreadcrumbManagerTabHelperTest, EventsLogged) { … }
TEST_F(BreadcrumbManagerTabHelperTest, UniqueEvents) { … }
TEST_F(BreadcrumbManagerTabHelperTest, GoogleNavigationStart) { … }
TEST_F(BreadcrumbManagerTabHelperTest, GooglePlayNavigationStart) { … }
#if !BUILDFLAG(IS_ANDROID)
TEST_F(BreadcrumbManagerTabHelperTest, ChromeNewTabNavigationStart) { … }
#endif
TEST_F(BreadcrumbManagerTabHelperTest, NavigationUniqueId) { … }
TEST_F(BreadcrumbManagerTabHelperTest, RendererInitiatedByUser) { … }
TEST_F(BreadcrumbManagerTabHelperTest, RendererInitiatedByScript) { … }
TEST_F(BreadcrumbManagerTabHelperTest, BrowserInitiatedByScript) { … }
TEST_F(BreadcrumbManagerTabHelperTest, PdfLoad) { … }
TEST_F(BreadcrumbManagerTabHelperTest, PageLoadSuccess) { … }
TEST_F(BreadcrumbManagerTabHelperTest, PageLoadFailure) { … }
#if !BUILDFLAG(IS_ANDROID)
TEST_F(BreadcrumbManagerTabHelperTest, NtpPageLoad) { … }
#endif
TEST_F(BreadcrumbManagerTabHelperTest, NavigationError) { … }
TEST_F(BreadcrumbManagerTabHelperTest, AddInfobar) { … }
TEST_F(BreadcrumbManagerTabHelperTest, InfobarTypes) { … }
TEST_F(BreadcrumbManagerTabHelperTest, RemoveInfobarNotAnimated) { … }
TEST_F(BreadcrumbManagerTabHelperTest, RemoveInfobarAnimated) { … }
TEST_F(BreadcrumbManagerTabHelperTest, ReplaceInfobar) { … }
TEST_F(BreadcrumbManagerTabHelperTest, SequentialInfobarReplacements) { … }