chromium/net/socket/websocket_endpoint_lock_manager_unittest.cc

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

#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) {}

// UnlockEndpoint() should cause any LockReleasers for this endpoint to be
// unregistered.
TEST_F(WebSocketEndpointLockManagerTest, LockReleaserForgottenOnUnlock) {}

// When ownership of the endpoint is passed to a new waiter, the new waiter can
// construct another LockReleaser.
TEST_F(WebSocketEndpointLockManagerTest, NextWaiterCanCreateLockReleaserAgain) {}

// Destroying LockReleaser after UnlockEndpoint() does nothing.
TEST_F(WebSocketEndpointLockManagerTest,
       DestroyLockReleaserAfterUnlockEndpointDoesNothing) {}

// UnlockEndpoint() should always be asynchronous.
TEST_F(WebSocketEndpointLockManagerTest, UnlockEndpointIsAsynchronous) {}

// UnlockEndpoint() should normally have a delay.
TEST_F(WebSocketEndpointLockManagerTest, UnlockEndpointIsDelayed) {}

}  // namespace

}  // namespace net