#include <memory>
#include <set>
#include <string>
#include <string_view>
#include <vector>
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/synchronization/lock.h"
#include "base/test/scoped_feature_list.h"
#include "base/thread_annotations.h"
#include "build/build_config.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.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/private_network_access_util.h"
#include "content/public/test/resource_load_observer.h"
#include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_byte_range.h"
#include "net/http/http_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/embedded_test_server_connection_listener.h"
#include "net/test/embedded_test_server/http_request.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/features.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
namespace {
METHOD_GET;
METHOD_OPTIONS;
ElementsAre;
IsEmpty;
constexpr char kLocalHost[] = …;
constexpr char kOtherLocalHost[] = …;
constexpr char kPrivateHost[] = …;
constexpr char kPublicHost[] = …;
constexpr char kDefaultPath[] = …;
constexpr char kTreatAsPublicAddressPath[] = …;
constexpr char kCorsPath[] = …;
constexpr char kPnaPath[] = …;
constexpr char kCacheablePath[] = …;
constexpr char kCacheableCorsPath[] = …;
constexpr char kCacheablePnaPath[] = …;
std::string MakePnaPathForIframe(const url::Origin& initiator_origin) { … }
std::string FetchSubresourceScript(const GURL& url) { … }
class PolicyTestContentBrowserClient
: public ContentBrowserTestContentBrowserClient { … };
class ConnectionCounter
: public net::test_server::EmbeddedTestServerConnectionListener { … };
class RequestObserver { … };
std::optional<std::string_view> StripPrefix(std::string_view str,
std::string_view prefix) { … }
const std::string* FindRequestHeader(
const net::test_server::HttpRequest& request,
std::string_view header) { … }
std::string GetContentRangeHeader(const net::HttpByteRange& range,
size_t total_size) { … }
std::unique_ptr<net::test_server::HttpResponse> HandleRangeRequest(
const net::test_server::HttpRequest& request) { … }
class FakeAddressSpaceServer { … };
}
class PrivateNetworkAccessBrowserTestBase : public ContentBrowserTest { … };
class PrivateNetworkAccessBrowserTest
: public PrivateNetworkAccessBrowserTestBase { … };
FeatureVec;
class PrivateNetworkAccessSandboxedDataBrowserTest
: public PrivateNetworkAccessBrowserTestBase,
public testing::WithParamInterface<bool> { … };
class PrivateNetworkAccessBrowserTestWithBlockInsteadOfWarnOption
: public PrivateNetworkAccessBrowserTest,
public testing::WithParamInterface<bool> { … };
class PrivateNetworkAccessBrowserTestDisableWebSecurity
: public PrivateNetworkAccessBrowserTest { … };
class PrivateNetworkAccessBrowserTestBlockFromPrivate
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestBlockFromUnknown
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestForNavigations
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestForNavigationsWarningOnly
: public PrivateNetworkAccessBrowserTestForNavigations { … };
class PrivateNetworkAccessBrowserTestNoPreflights
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestRespectPreflightResults
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestForWorkers
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers
: public PrivateNetworkAccessBrowserTestBase { … };
class
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkersWarningOnly
: public PrivateNetworkAccessBrowserTestBase { … };
class PrivateNetworkAccessBrowserTestNoBlocking
: public PrivateNetworkAccessBrowserTestBase { … };
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForInitialEmptyDoc) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForAboutBlank) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForDataURL) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForFileURL) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForInsecureLocalAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForInsecurePrivateAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForInsecurePublicAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSecureLocalAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSecurePrivateAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSecurePublicAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForNullIP) { … }
class PrivateNetworkAccessBrowserTestNullIPKillswitch
: public PrivateNetworkAccessBrowserTestBase { … };
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNullIPKillswitch,
ClientSecurityStateForNullIPKillswitch) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForTreatAsPublicAddress) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForTreatAsPublicAddressReportOnly) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForCachedSecureLocalDocument) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForCachedInsecurePublicDocument) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSpecialSchemeChromeURL) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSpecialSchemeViewSourcePublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSpecialSchemeViewSourcePrivate) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSpecialSchemeChromeErrorPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
ClientSecurityStateForSpecialSchemeChromeErrorPrivate) { … }
namespace {
GURL CreateBlobURL(RenderFrameHostImpl* frame_host) { … }
RenderFrameHostImpl* AddChildWithScript(RenderFrameHostImpl* parent,
const std::string& script) { … }
RenderFrameHostImpl* GetFirstChild(RenderFrameHostImpl& parent) { … }
RenderFrameHostImpl* AddChildFromURL(RenderFrameHostImpl* parent,
std::string_view url) { … }
RenderFrameHostImpl* AddChildFromURL(RenderFrameHostImpl* parent,
const GURL& url) { … }
void AddChildFromURLWithoutWaiting(RenderFrameHostImpl* parent,
std::string_view url) { … }
void AddChildFromURLWithoutWaiting(RenderFrameHostImpl* parent,
const GURL& url) { … }
RenderFrameHostImpl* AddChildFromAboutBlank(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddChildInitialEmptyDoc(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddChildFromSrcdoc(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddChildFromDataURL(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddChildFromJavascriptURL(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddChildFromBlob(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddSandboxedChildFromURL(RenderFrameHostImpl* parent,
const GURL& url) { … }
RenderFrameHostImpl* AddSandboxedChildFromAboutBlank(
RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddSandboxedChildInitialEmptyDoc(
RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddSandboxedChildFromSrcdoc(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddSandboxedChildFromDataURL(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* AddSandboxedChildFromBlob(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* GetPrimaryMainFrameHostImpl(Shell* shell) { … }
RenderFrameHostImpl* OpenWindowFromURL(RenderFrameHostImpl* parent,
const GURL& url) { … }
RenderFrameHostImpl* OpenWindowFromAboutBlank(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* OpenWindowFromAboutBlankNoOpener(
RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* OpenWindowFromURLExpectNoCommit(
RenderFrameHostImpl* parent,
const GURL& url,
std::string_view features = "") { … }
RenderFrameHostImpl* OpenWindowInitialEmptyDoc(RenderFrameHostImpl* parent) { … }
RenderFrameHostImpl* OpenWindowInitialEmptyDocNoOpener(
RenderFrameHostImpl* parent) { … }
GURL JavascriptURL(std::string_view script) { … }
RenderFrameHostImpl* OpenWindowFromJavascriptURL(
RenderFrameHostImpl* parent,
std::string_view script = "'foo'") { … }
RenderFrameHostImpl* OpenWindowFromJavascriptURLNoOpener(
RenderFrameHostImpl* parent,
std::string_view script) { … }
RenderFrameHostImpl* OpenWindowFromBlob(RenderFrameHostImpl* parent) { … }
}
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForAboutBlankFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForAboutBlankFromLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForAboutBlankFromPublic) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForAboutBlankFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForAboutBlankFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForAboutBlankFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeNoOpenerAddressSpaceForAboutBlankIsLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForInitialEmptyDocFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForInitialEmptyDocFromLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForInitialEmptyDocFromPublic) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForInitialEmptyDocFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForInitialEmptyDocFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForInitialEmptyDocFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeNoOpenerAddressSpaceForInitialEmptyDocIsLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForAboutSrcdocFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForAboutSrcdocFromLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForAboutSrcdocFromPublic) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForAboutSrcdocFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForDataURLFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForDataURLFromLocal) { … }
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessSandboxedDataBrowserTest,
SandboxedIframeInheritsAddressSpaceForDataURLFromPublic) { … }
IN_PROC_BROWSER_TEST_P(PrivateNetworkAccessSandboxedDataBrowserTest,
SandboxedIframeInheritsAddressSpaceForDataURLFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForJavascriptURLFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForJavascriptURLFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForJavascriptURLFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForJavascriptURLFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeNoOpenerAddressSpaceForJavascriptURLIsLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForBlobURLFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsAddressSpaceForBlobURLFromLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForBlobURLFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsAddressSpaceForBlobURLFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForBlobURLFromPublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsAddressSpaceForBlobURLFromLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForAboutBlankFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForAboutBlankFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForAboutBlankFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForAboutBlankFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForAboutBlankFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForAboutBlankFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForInitialEmptyDocFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForInitialEmptyDocFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForInitialEmptyDocFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForInitialEmptyDocFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForInitialEmptyDocFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForInitialEmptyDocFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForAboutSrcdocFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForAboutSrcdocFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForAboutSrcdocFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForAboutSrcdocFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForDataURLFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForDataURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForDataURLFromSecure) { … }
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessSandboxedDataBrowserTest,
SandboxedIframeInheritsSecureContextForDataURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForJavascriptURLFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForJavascriptURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForJavascriptURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForJavascriptURLFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForBlobURLFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeInheritsSecureContextForBlobURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForBlobURLFromSecure) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
SandboxedIframeInheritsSecureContextForBlobURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForBlobURLFromSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
OpeneeInheritsSecureContextForBlobURLFromInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestDisableWebSecurity,
PrivateNetworkPolicyIsAllowInsecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestDisableWebSecurity,
PrivateNetworkPolicyIsAllowSecure) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoBlocking,
PrivateNetworkPolicyIsWarnByDefault) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoBlocking,
PrivateNetworkPolicyIsWarnByDefaultForSecureContexts) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessBrowserTestWithBlockInsteadOfWarnOption,
PrivateNetworkPolicyIsBlockByDefaultForInsecurePublic) { … }
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessBrowserTestWithBlockInsteadOfWarnOption,
PrivateNetworkPolicyForInsecurePrivate) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestBlockFromPrivate,
PrivateNetworkPolicyIsBlockForInsecurePrivate) { … }
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessBrowserTestWithBlockInsteadOfWarnOption,
PrivateNetworkPolicyIsAllowByDefaultForInsecureUnknown) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestBlockFromUnknown,
PrivateNetworkPolicyIsBlockForInsecureUnknown) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoPreflights,
PrivateNetworkPolicyIsAllowByDefaultForSecureContexts) { … }
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessBrowserTestWithBlockInsteadOfWarnOption,
PrivateNetworkPolicyForSecureContexts) { … }
IN_PROC_BROWSER_TEST_P(
PrivateNetworkAccessBrowserTestWithBlockInsteadOfWarnOption,
PrivateNetworkPolicyIsBlockForInsecurePublic) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
PrivateNetworkPolicyIsPreflightBlockForSecureContexts) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
PrivateNetworkPolicyIsWarnForInsecurePrivate) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
PrivateNetworkPolicyIsBlockForInsecurePublic) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
DISABLED_PrivateNetworkRequestPolicyCalculatedPerOrigin) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
PrivateNetworkRequestPolicyInheritedWithOriginForInitialEmptyDoc) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
PrivateNetworkRequestPolicyInheritedWithOriginForAboutBlank) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
PrivateNetworkRequestPolicyNotInheritedWithOriginForDataURL) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
PrivateNetworkRequestPolicyNotInheritedForSandboxedInitialEmptyDoc) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
PrivateNetworkRequestPolicyNotInheritedForSandboxedAboutBlank) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
PrivateNetworkRequestPolicyIsAllowForErrorPage) { … }
class PrivateNetworkAccessDeprecationTrialDisabledBrowserTest
: public PrivateNetworkAccessBrowserTestBase { … };
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessDeprecationTrialDisabledBrowserTest,
OriginEnabledDoesNothing) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialOriginEnabled) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialOriginDisabled) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialSettingInheritedByInitialEmptyDoc) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialSettingInheritedByAboutBlank) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialSettingNotInheritedByDataURL) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialSettingNotInheritedBySandboxedIframe) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
DeprecationTrialSettingNotInheritedByErrorPage) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoBlocking,
PrivateNetworkRequestIsNotBlockedByDefault) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestDisableWebSecurity,
PrivateNetworkRequestIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromSecureTreatAsPublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoPreflights,
FromSecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromSecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecurePublicToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoPreflights,
FromSecurePrivateToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromSecurePrivateToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecurePrivateToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoPreflights,
FromSecureLocalToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromSecureLocalToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecureLocalToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromSecurePublicToLocalPreflightOK) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecurePublicToLocalPreflightOK) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
DISABLED_PreflightConnectionReusedHttp1) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
PreflightConnectionReusedHttp2) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
FromInsecureTreatAsPublicToLocalWithPolicySetToAllowIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromInsecureTreatAsPublicToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromInsecurePublicToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromInsecurePrivateToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestBlockFromPrivate,
FromInsecurePrivateToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromInsecureLocalToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTest,
FromSecurePublicEmbeddedInInsecureLocalToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromInsecureLocalToCachedLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromInsecurePublicToCachedLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecureLocalToCachedLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FromSecurePublicToCachedLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecurePublicToCachedLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestRespectPreflightResults,
FromSecurePublicToCachedLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoBlocking,
InsecurePageCannotRequestFile) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestNoBlocking,
SecurePageCannotRequestFile) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest, Redirect) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest, PrefixRangePreflight) { … }
namespace {
constexpr char kWorkerScriptPath[] = …;
constexpr char kWorkerScriptWithPnaHeadersPath[] = …;
std::string FetchWorkerScript(std::string_view path) { … }
constexpr char kSharedWorkerScriptPath[] = …;
constexpr char kSharedWorkerScriptWithPnaHeadersPath[] = …;
std::string FetchSharedWorkerScript(std::string_view path) { … }
void ExpectFetchSharedWorkerScriptResult(bool expected,
const EvalJsResult& result) { … }
}
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FetchWorkerFromInsecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForWorkers,
FetchWorkerFromInsecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers,
FetchWorkerFromInsecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkersWarningOnly,
FetchWorkerFromInsecurePublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FetchWorkerFromSecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForWorkers,
FetchWorkerFromSecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers,
FetchWorkerFromSecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkersWarningOnly,
FetchWorkerFromSecurePublicToLocalFailedPreflight) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers,
FetchWorkerFromSecureTreatAsPublicToLocalSuccess) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FetchSharedWorkerFromInsecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForWorkers,
FetchSharedWorkerFromInsecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers,
FetchSharedWorkerFromInsecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkersWarningOnly,
FetchSharedWorkerFromInsecurePublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
FetchSharedWorkerFromSecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForWorkers,
FetchSharedWorkerFromSecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers,
FetchSharedWorkerFromSecureTreatAsPublicToLocal) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkersWarningOnly,
FetchSharedWorkerFromSecurePublicToLocalFailedPreflight) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestRespectPreflightResultsForWorkers,
FetchSharedWorkerFromSecureTreatAsPublicToLocalSuccess) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeFromInsecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTest,
IframeFromSecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigationsWarningOnly,
IframeFromInsecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
IframeFromInsecurePublicToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
IframeFromInsecureTreatAsPublicToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
FailedNavigationCommitsErrorPage) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigationsWarningOnly,
IframeFromSecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
IframeFromSecurePublicToLocalIsBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
IframeFromSecurePublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
IframeFromSecureTreatAsPublicToLocalIsNotBlocked) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestForNavigations,
FormSubmissionFromInsecurePublicToLocalIsBlockedInMainFrame) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestForNavigations,
FormSubmissionFromInsecurePublicToLocalIsBlockedInChildFrame) { … }
IN_PROC_BROWSER_TEST_F(
PrivateNetworkAccessBrowserTestForNavigations,
FormSubmissionGetFromInsecurePublicToLocalIsBlockedInChildFrame) { … }
IN_PROC_BROWSER_TEST_F(PrivateNetworkAccessBrowserTestForNavigations,
SiblingNavigationFromInsecurePublicToLocalIsBlocked) { … }
}