chromium/base/supports_user_data_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 "base/supports_user_data.h"

#include "base/features.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace {

struct TestSupportsUserData : public SupportsUserData {};

struct UsesItself : public SupportsUserData::Data {};

SupportsUserDataTest;

TEST_F(SupportsUserDataTest, ClearWorksRecursively) {}

struct TestData : public SupportsUserData::Data {};

TEST_F(SupportsUserDataTest, Movable) {}

TEST_F(SupportsUserDataTest, ClearAllUserData) {}

TEST_F(SupportsUserDataTest, TakeUserData) {}

class DataOwnsSupportsUserData : public SupportsUserData::Data {};

// Tests that removing a `SupportsUserData::Data` that owns a `SupportsUserData`
// does not crash.
TEST_F(SupportsUserDataTest, ReentrantRemoveUserData) {}

TEST_F(SupportsUserDataTest, ReentrantSetUserDataDuringRemoval) {}

}  // namespace
}  // namespace base