#include "components/safe_browsing/content/browser/safe_browsing_navigation_observer.h"
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "components/content_settings/core/browser/content_settings_observer.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/sessions/content/session_tab_helper.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/fake_service_worker_context.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/window_open_disposition.h"
namespace safe_browsing {
class SBNavigationObserverTest : public content::RenderViewHostTestHarness { … };
TEST_F(SBNavigationObserverTest, TestNavigationEventList) { … }
TEST_F(SBNavigationObserverTest, TestInfiniteLoop) { … }
TEST_F(SBNavigationObserverTest, TestFindEventInCorrectOutermostFrame) { … }
TEST_F(SBNavigationObserverTest, TestBasicReferrerChain) { … }
TEST_F(SBNavigationObserverTest, BasicNavigationAndCommit) { … }
TEST_F(SBNavigationObserverTest, ServerRedirect) { … }
TEST_F(SBNavigationObserverTest,
TestNotificationNavigationEventsNotAddedForNonESBUsers) { … }
TEST_F(SBNavigationObserverTest,
TestNotificationNavigationEventsAddedForExtensions) { … }
TEST_F(SBNavigationObserverTest,
TestNotificationNavigationEventsNotAddedForNonExtensionsAndNonHttps) { … }
TEST_F(SBNavigationObserverTest,
TestCleanUpStableNotificationNavigationEvents) { … }
TEST_F(SBNavigationObserverTest,
TestAddDesktopNotificationOriginToReferrerChain) { … }
TEST_F(SBNavigationObserverTest,
TestAddAndroidNotificationOriginToReferrerChain) { … }
TEST_F(SBNavigationObserverTest, TestCleanUpStaleNavigationEvents) { … }
TEST_F(SBNavigationObserverTest, TestCleanUpStaleUserGestures) { … }
TEST_F(SBNavigationObserverTest, TestCleanUpStaleIPAddresses) { … }
TEST_F(SBNavigationObserverTest, TestRecordHostToIpMapping) { … }
TEST_F(SBNavigationObserverTest, TestContentSettingChange) { … }
TEST_F(SBNavigationObserverTest, TimestampIsDecreasing) { … }
TEST_F(SBNavigationObserverTest,
RemoveMiddleNonUserGestureEntriesForRecentNavigation) { … }
TEST_F(SBNavigationObserverTest,
RemoveNonUserGestureEntriesWithExcessiveUserGestureEvents) { … }
TEST_F(SBNavigationObserverTest, RemoveMiddleReferrerChains) { … }
TEST_F(SBNavigationObserverTest, ChainWorksThroughNewTab) { … }
TEST_F(SBNavigationObserverTest, ChainContinuesThroughBrowserInitiated) { … }
TEST_F(SBNavigationObserverTest,
CanceledRetargetingNavigationHasCorrectEventUrl) { … }
TEST_F(SBNavigationObserverTest,
CanceledRetargetingNavigationHasCorrectRedirects) { … }
TEST_F(SBNavigationObserverTest, TestGetLatestPendingNavigationEvent) { … }
TEST_F(SBNavigationObserverTest, SanitizesDataUrls) { … }
}