chromium/base/scoped_multi_source_observation_unittest.cc

// Copyright 2020 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/scoped_multi_source_observation.h"

#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/scoped_observation_traits.h"
#include "base/test/gtest_util.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace {

class TestSourceObserver {};

class TestSource {};

void TestSource::AddObserver(TestSourceObserver* observer) {}

void TestSource::RemoveObserver(TestSourceObserver* observer) {}

bool TestSource::HasObserver(TestSourceObserver* observer) const {}

TestScopedMultiSourceObservation;

class ScopedMultiSourceObservationTest : public testing::Test {};

}  // namespace

TEST_F(ScopedMultiSourceObservationTest, RemovesSourcesOnDestruction) {}

TEST_F(ScopedMultiSourceObservationTest, RemoveObservation) {}

TEST_F(ScopedMultiSourceObservationTest, RemoveAllObservations) {}

TEST_F(ScopedMultiSourceObservationTest, IsObservingSource) {}

TEST_F(ScopedMultiSourceObservationTest, IsObservingAnySource) {}

TEST_F(ScopedMultiSourceObservationTest, GetSourcesCount) {}

namespace {

// A test source with oddly named Add/Remove functions.
class TestSourceWithNonDefaultNames {};

TestScopedMultiSourceObservationWithNonDefaultNames;

}  // namespace

template <>
struct ScopedObservationTraits<TestSourceWithNonDefaultNames,
                               TestSourceObserver> {};

TEST_F(ScopedMultiSourceObservationTest, NonDefaultNames) {}

}  // namespace base