#include "components/blocked_content/popup_blocker_tab_helper.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "base/test/scoped_feature_list.h"
#include "components/blocked_content/popup_navigation_delegate.h"
#include "components/blocked_content/safe_browsing_triggered_popup_blocker.h"
#include "components/blocked_content/test/test_popup_navigation_delegate.h"
#include "components/blocked_content/url_list_manager.h"
#include "components/content_settings/browser/page_specific_content_settings.h"
#include "components/content_settings/browser/test_page_specific_content_settings_delegate.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/test_renderer_host.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/mojom/window_features/window_features.mojom.h"
#include "ui/base/window_open_disposition.h"
namespace blocked_content {
namespace {
Pair;
UnorderedElementsAre;
constexpr char kUrl1[] = …;
constexpr char kUrl2[] = …;
class BlockedUrlListObserver : public UrlListManager::Observer { … };
}
class PopupBlockerTabHelperTest : public content::RenderViewHostTestHarness { … };
TEST_F(PopupBlockerTabHelperTest, BlocksAndShowsPopup) { … }
TEST_F(PopupBlockerTabHelperTest, MultiplePopups) { … }
TEST_F(PopupBlockerTabHelperTest, DoesNotShowPopupWithInvalidID) { … }
TEST_F(PopupBlockerTabHelperTest, SetsContentSettingsPopupState) { … }
TEST_F(PopupBlockerTabHelperTest, ClearsContentSettingsPopupStateOnNavigation) { … }
TEST_F(PopupBlockerTabHelperTest,
NavigatingNonPrimaryDoesntClearsContentSettings) { … }
}