#include "third_party/blink/public/web/web_document.h"
#include <algorithm>
#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/origin_trials/scoped_test_origin_trial_policy.h"
#include "third_party/blink/public/web/web_origin_trials.h"
#include "third_party/blink/renderer/core/css/css_property_names.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_link_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/testing/mock_policy_container_host.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
WebViewHelper;
ToKURL;
const char kDefaultOrigin[] = …;
const char kOriginTrialDummyFilePath[] = …;
const char kNoOriginTrialDummyFilePath[] = …;
class WebDocumentTest : public testing::Test { … };
void WebDocumentTest::SetUpTestSuite() { … }
void WebDocumentTest::LoadURL(const std::string& url) { … }
Document* WebDocumentTest::TopDocument() const { … }
WebDocument WebDocumentTest::TopWebDocument() const { … }
TEST_F(WebDocumentTest, InsertAndRemoveStyleSheet) { … }
TEST_F(WebDocumentTest, OriginTrialDisabled) { … }
TEST_F(WebDocumentTest, OriginTrialEnabled) { … }
namespace {
const char* g_base_url_origin_a = …;
const char* g_base_url_origin_sub_a = …;
const char* g_base_url_origin_secure_a = …;
const char* g_base_url_origin_b = …;
const char* g_empty_file = …;
const char* g_nested_data = …;
const char* g_nested_origin_a = …;
const char* g_nested_origin_sub_a = …;
const char* g_nested_origin_secure_a = …;
const char* g_nested_origin_a_in_origin_a = …;
const char* g_nested_origin_a_in_origin_b = …;
const char* g_nested_origin_b = …;
const char* g_nested_origin_b_in_origin_a = …;
const char* g_nested_origin_b_in_origin_b = …;
const char* g_nested_src_doc = …;
KURL ToFile(const char* file) { … }
KURL ToOriginA(const char* file) { … }
KURL ToOriginSubA(const char* file) { … }
KURL ToOriginSecureA(const char* file) { … }
KURL ToOriginB(const char* file) { … }
void RegisterMockedURLLoad(const KURL& url, const char* path) { … }
}
class WebDocumentFirstPartyTest : public WebDocumentTest { … };
void WebDocumentFirstPartyTest::SetUpTestSuite() { … }
void WebDocumentFirstPartyTest::Load(const char* file) { … }
Document* WebDocumentFirstPartyTest::NestedDocument() const { … }
Document* WebDocumentFirstPartyTest::NestedNestedDocument() const { … }
bool OriginsEqual(const char* path,
scoped_refptr<const SecurityOrigin> origin) { … }
bool SiteForCookiesEqual(const char* path,
const net::SiteForCookies& site_for_cookies) { … }
TEST_F(WebDocumentFirstPartyTest, Empty) { … }
TEST_F(WebDocumentFirstPartyTest, EmptySandbox) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginA) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginASchemefulSiteForCookies) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginSubA) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginSecureA) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginSecureASchemefulSiteForCookies) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginAInOriginA) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginAInOriginB) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginB) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginBInOriginA) { … }
TEST_F(WebDocumentFirstPartyTest, NestedOriginBInOriginB) { … }
TEST_F(WebDocumentFirstPartyTest, NestedSrcdoc) { … }
TEST_F(WebDocumentFirstPartyTest, NestedData) { … }
TEST_F(WebDocumentFirstPartyTest,
NestedOriginAInOriginBWithFirstPartyOverride) { … }
TEST_F(WebDocumentFirstPartyTest, FileScheme) { … }
}