chromium/net/websockets/websocket_stream_cookie_test.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "net/base/isolation_info.h"
#include "net/base/net_errors.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/canonical_cookie_test_helpers.h"
#include "net/cookies/cookie_access_result.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_options.h"
#include "net/cookies/cookie_partition_key.h"
#include "net/cookies/cookie_partition_key_collection.h"
#include "net/cookies/cookie_store.h"
#include "net/cookies/cookie_util.h"
#include "net/cookies/site_for_cookies.h"
#include "net/http/http_request_headers.h"
#include "net/socket/socket_test_util.h"
#include "net/storage_access_api/status.h"
#include "net/url_request/url_request_context.h"
#include "net/websockets/websocket_stream.h"
#include "net/websockets/websocket_stream_create_test_base.h"
#include "net/websockets/websocket_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"

namespace net {
namespace {

TestWithParam;
ValuesIn;

constexpr WebSocketExtraHeaders kNoCookieHeader =;

class TestBase : public WebSocketStreamCreateTestBase {};

struct ClientUseCookieParameter {};

class WebSocketStreamClientUseCookieTest
    : public TestBase,
      public TestWithParam<ClientUseCookieParameter> {};

struct ServerSetCookieParameter {};

class WebSocketStreamServerSetCookieTest
    : public TestBase,
      public TestWithParam<ServerSetCookieParameter> {};

TEST_P(WebSocketStreamClientUseCookieTest, ClientUseCookie) {}

TEST_P(WebSocketStreamServerSetCookieTest, ServerSetCookie) {}

// Test parameters definitions follow...

// The WebSocketExtraHeaders field can't be initialized at compile time, so this
// array is constructed at startup, but that's okay in a test.
const ClientUseCookieParameter kClientUseCookieParameters[] =;

INSTANTIATE_TEST_SUITE_P();

// As with `kClientUseCookieParameters`, this is initialised at runtime.
const ServerSetCookieParameter kServerSetCookieParameters[] =;

INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace net