#include "net/socket/websocket_endpoint_lock_manager.h"
#include "base/check.h"
#include "base/run_loop.h"
#include "base/time/time.h"
#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/next_proto.h"
#include "net/socket/socket_test_util.h"
#include "net/test/gtest_util.h"
#include "net/test/test_with_task_environment.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
IsOk;
namespace net {
namespace {
class FakeWaiter : public WebSocketEndpointLockManager::Waiter { … };
class BlockingWaiter : public FakeWaiter { … };
class WebSocketEndpointLockManagerTest : public TestWithTaskEnvironment { … };
TEST_F(WebSocketEndpointLockManagerTest, LockEndpointReturnsOkOnce) { … }
TEST_F(WebSocketEndpointLockManagerTest, GotEndpointLockNotCalledOnOk) { … }
TEST_F(WebSocketEndpointLockManagerTest, GotEndpointLockNotCalledImmediately) { … }
TEST_F(WebSocketEndpointLockManagerTest, GotEndpointLockCalledWhenUnlocked) { … }
TEST_F(WebSocketEndpointLockManagerTest,
EndpointUnlockedIfWaiterAlreadyDeleted) { … }
TEST_F(WebSocketEndpointLockManagerTest, LockReleaserWorks) { … }
TEST_F(WebSocketEndpointLockManagerTest, LockReleaserForgottenOnUnlock) { … }
TEST_F(WebSocketEndpointLockManagerTest, NextWaiterCanCreateLockReleaserAgain) { … }
TEST_F(WebSocketEndpointLockManagerTest,
DestroyLockReleaserAfterUnlockEndpointDoesNothing) { … }
TEST_F(WebSocketEndpointLockManagerTest, UnlockEndpointIsAsynchronous) { … }
TEST_F(WebSocketEndpointLockManagerTest, UnlockEndpointIsDelayed) { … }
}
}