#include <optional>
#include <string>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "content/browser/bad_message.h"
#include "content/browser/renderer_host/frame_tree.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/site_isolation_policy.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.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/test_utils.h"
#include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "ipc/ipc_security_test_util.h"
#include "net/base/features.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_access_result.h"
#include "net/cookies/cookie_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/alternative_service.h"
#include "net/storage_access_api/status.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/mojom/restricted_cookie_manager.mojom-test-utils.h"
#include "services/network/public/mojom/restricted_cookie_manager.mojom.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace content {
namespace {
void SetCookieFromJS(RenderFrameHost* frame, std::string cookie) { … }
std::string GetCookieFromJS(RenderFrameHost* frame) { … }
void SetCookieDirect(WebContentsImpl* tab,
const GURL& url,
const std::string& cookie_line) { … }
std::string GetCookiesDirect(WebContentsImpl* tab, const GURL& url) { … }
}
class CookieBrowserTest : public ContentBrowserTest { … };
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, Cookies) { … }
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, CookiePriority) { … }
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, SameSiteCookies) { … }
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, CookieTruncatingCharFromJavascript) { … }
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, CookieTruncatingCharFromHeaders) { … }
class RestrictedCookieManagerInterceptor
: public network::mojom::RestrictedCookieManagerInterceptorForTesting { … };
class CookieStoreContentBrowserClient
: public ContentBrowserTestContentBrowserClient { … };
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, CrossSiteCookieSecurityEnforcement) { … }
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, ETldDomainCookies) { … }
IN_PROC_BROWSER_TEST_F(CookieBrowserTest, ETldDomainCookiesHeader) { … }
}