#include <tuple>
#include "base/base64.h"
#include "base/files/file_path.h"
#include "base/memory/raw_ref.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_content_browser_client.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/content_mock_cert_verifier.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_base.h"
#include "net/base/features.h"
#include "net/base/filename_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "net/test/test_data_directory.h"
#include "third_party/blink/public/common/features.h"
namespace content {
ContentSecurityPolicyBrowserTest;
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
WasmEvalBlockedConsoleMessage) { … }
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
TrustedTypesCreatePolicyDupeMessage) { … }
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
TrustedTypesCreatePolicyForbiddenMessage) { … }
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
WildcardNotMatchingNonNetworkSchemeBrowserSide) { … }
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
WildcardNotMatchingNonNetworkSchemeRendererSide) { … }
namespace {
base::FilePath TestFilePath(const char* filename) { … }
}
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest, FileURLs) { … }
IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest, CSPAttributeTooLong) { … }
class TransparentPlaceholderImageContentSecurityPolicyBrowserTest
: public ContentSecurityPolicyBrowserTest,
public ::testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(
TransparentPlaceholderImageContentSecurityPolicyBrowserTest,
ImgSrcPolicyEnforced) { … }
IN_PROC_BROWSER_TEST_P(
TransparentPlaceholderImageContentSecurityPolicyBrowserTest,
ImgSrcPolicyReported) { … }
namespace {
constexpr char kWebmPath[] = …;
std::unique_ptr<net::test_server::HttpResponse> ServeCSPMedia(
const net::test_server::HttpRequest& request) { … }
}
class ThirdPartyCookiesContentSecurityPolicyBrowserTest
: public ContentSecurityPolicyBrowserTest { … };
IN_PROC_BROWSER_TEST_F(ThirdPartyCookiesContentSecurityPolicyBrowserTest,
CSPMediaThirdPartyCookieBlocking) { … }
IN_PROC_BROWSER_TEST_F(ThirdPartyCookiesContentSecurityPolicyBrowserTest,
CSPMediaThirdPartyCookieBlocking_IFrame) { … }
}