#include "components/content_settings/renderer/content_settings_agent_impl.h"
#include <stddef.h>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "content/public/common/url_constants.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/test/render_view_test.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "net/cookies/site_for_cookies.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/navigation/navigation_params.h"
#include "third_party/blink/public/mojom/loader/code_cache.mojom.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/test/test_web_frame_content_dumper.h"
#include "third_party/blink/public/web/web_view.h"
#include "url/gurl.h"
#include "url/url_util.h"
namespace content_settings {
namespace {
constexpr char kAllowlistScheme[] = …;
class MockContentSettingsManagerImpl : public mojom::ContentSettingsManager { … };
class MockContentSettingsAgentDelegate
: public ContentSettingsAgentImpl::Delegate { … };
class MockContentSettingsAgentImpl : public ContentSettingsAgentImpl { … };
MockContentSettingsAgentImpl::MockContentSettingsAgentImpl(
content::RenderFrame* render_frame)
: … { … }
void MockContentSettingsAgentImpl::BindContentSettingsManager(
mojo::Remote<mojom::ContentSettingsManager>* manager) { … }
class CommitTimeConditionChecker : public content::RenderFrameObserver { … };
}
enum class BackgroundResourceFetchTestCase { … };
class ContentSettingsAgentImplBrowserTest
: public content::RenderViewTest,
public testing::WithParamInterface<BackgroundResourceFetchTestCase> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ContentSettingsAgentImplBrowserTest, DidBlockContentType) { … }
TEST_P(ContentSettingsAgentImplBrowserTest, AllowStorageAccessSync) { … }
TEST_P(ContentSettingsAgentImplBrowserTest, AllowStorageAccess) { … }
TEST_P(ContentSettingsAgentImplBrowserTest, MixedAutoupgradesDisabledByRules) { … }
TEST_P(ContentSettingsAgentImplBrowserTest, MixedAutoupgradesNoSettingsSet) { … }
}