#include "content/public/browser/cors_origin_pattern_setter.h"
#include <memory>
#include <string>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/isolated_world_ids.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/test_browser_context.h"
#include "content/shell/browser/shell.h"
#include "net/base/host_port_pair.h"
#include "net/dns/mock_host_resolver.h"
#include "services/network/public/mojom/cors.mojom.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
const auto kAllowSubdomains = …;
const auto kDisallowSubdomains = …;
const char kTestPath[] = …;
const char kTestHost[] = …;
const char kTestHostInDifferentCase[] = …;
const char kTestSubdomainHost[] = …;
class CorsOriginPatternSetterBrowserTest : public ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest, AllowAll) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest, AllowAllForIp) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest, AllowExactHost) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest,
AllowExactHostInCaseInsensitive) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest, BlockDifferentPort) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest, AllowSubdomain) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest, BlockSubdomain) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest,
BlockDifferentProtocol) { … }
IN_PROC_BROWSER_TEST_F(CorsOriginPatternSetterBrowserTest,
SubdomainMatchShouldNotBeAppliedForIPAddress) { … }
class NewContextCorsOriginPatternSetterBrowserTest
: public CorsOriginPatternSetterBrowserTest { … };
IN_PROC_BROWSER_TEST_F(NewContextCorsOriginPatternSetterBrowserTest,
PatternListPropagation) { … }
}