chromium/components/content_settings/renderer/content_settings_agent_impl_browsertest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Evaluates a boolean `predicate` every time a provisional load is committed in
// the given `frame` while the instance of this class is in scope, and verifies
// that the result matches the `expectation`.
class CommitTimeConditionChecker : public content::RenderFrameObserver {};

}  // namespace

enum class BackgroundResourceFetchTestCase {};

class ContentSettingsAgentImplBrowserTest
    : public content::RenderViewTest,
      public testing::WithParamInterface<BackgroundResourceFetchTestCase> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(ContentSettingsAgentImplBrowserTest, DidBlockContentType) {}

// Tests that multiple invocations of AllowStorageAccessSync result in a single
// IPC.
TEST_P(ContentSettingsAgentImplBrowserTest, AllowStorageAccessSync) {}

// Tests that multiple invocations of AllowStorageAccess result in a single IPC.
TEST_P(ContentSettingsAgentImplBrowserTest, AllowStorageAccess) {}

TEST_P(ContentSettingsAgentImplBrowserTest, MixedAutoupgradesDisabledByRules) {}

TEST_P(ContentSettingsAgentImplBrowserTest, MixedAutoupgradesNoSettingsSet) {}

}  // namespace content_settings