chromium/components/device_signals/core/browser/signals_aggregator_impl_unittest.cc

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

#include "components/device_signals/core/browser/signals_aggregator_impl.h"

#include <memory>
#include <unordered_set>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "components/device_signals/core/browser/mock_signals_collector.h"
#include "components/device_signals/core/browser/mock_user_permission_service.h"
#include "components/device_signals/core/browser/signals_types.h"
#include "components/device_signals/core/browser/user_context.h"
#include "components/device_signals/core/browser/user_permission_service.h"
#include "components/device_signals/core/common/signals_constants.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
Invoke;
Pointee;
Ref;
Return;

namespace device_signals {

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
namespace {
constexpr char kGaiaId[] =;
}  // namespace
#endif  // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)

class SignalsAggregatorImplTest : public testing::Test {};

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
// Tests that the aggregator will return an empty value when given an empty
// parameter dictionary.
TEST_F(SignalsAggregatorImplTest, GetSignalsForUser_NoSignal) {}

// Tests that the aggregator will return an empty value when given a request
// with multiple signal names.
TEST_F(SignalsAggregatorImplTest, GetSignalsForUser_MultipleSignals) {}

// Tests how the aggregator behaves when given a parameter with a single signal
// which is supported by one of the collectors.
TEST_F(SignalsAggregatorImplTest, GetSignalsForUser_SingleSignal_Supported) {}

// Tests how the aggregator behaves when given a parameter with a single signal
// that no collector supports.
TEST_F(SignalsAggregatorImplTest, GetSignalsForUser_SingleSignal_Unsupported) {}

// Tests how the aggregator behaves when encountering user permission errors.
TEST_F(SignalsAggregatorImplTest, GetSignalsForUser_InvalidUserPermissions) {}
#endif  // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)

// Tests how the aggregator behaves when given a parameter with a single signal
// which is supported by one of the collectors. Specifically tests the API that
// does not accept a parameterized user context.
TEST_F(SignalsAggregatorImplTest, GetSignals_SingleSignal_Supported) {}

// Tests how the aggregator behaves when encountering user permission errors
// when called via the API that does not accept a parameterized user context.
TEST_F(SignalsAggregatorImplTest, GetSignals_SingleSignal_NoPermission) {}

}  // namespace device_signals