chromium/content/browser/webid/digital_credentials/digital_identity_request_impl_unittest.cc

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

#include "content/browser/webid/digital_credentials/digital_identity_request_impl.h"

#include <optional>

#include "base/json/json_reader.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "content/browser/webid/test/stub_digital_identity_provider.h"
#include "content/public/common/content_features.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace content {
namespace {

InterstitialType;

// StubDigitalIdentityProvider which enables overriding
// DigitalIdentityProvider::IsLowRiskOrigin().
class TestDigitalIdentityProviderWithCustomRisk
    : public StubDigitalIdentityProvider {};

base::Value ParseJsonAndCheck(const std::string& json) {}

base::Value GenerateOnlyAgeOpenid4VpRequest() {}

base::Value GenerateOnlyAgePreviewRequest() {}

// Does depth-first traversal of nested dicts rooted at `root`. Returns first
// matching base::Value with key `find_key`.
base::Value* FindValueWithKey(base::Value& root, const std::string& find_key) {}

bool HasNoListElements(const base::Value* value) {}

bool IsNonEmptyList(const base::Value* value) {}

// Removes `find_key` if present from `dict`. Ignores nested base::Value::Dicts.
void RemoveDictKey(base::Value::Dict& dict, const std::string& find_key) {}

// Used to modify an Openid4VpRequest on the fly.
bool SetPathItem(base::Value& to_modify, const std::string& path_item) {}

// Used to modify a Preview on the fly.
bool SetFieldNameValue(base::Value& to_modify,
                       const std::string& field_name_value) {}

std::optional<InterstitialType> ComputeInterstitialType(Protocol protocol,
                                                        base::Value request) {}

}  // anonymous namespace

class DigitalIdentityRequestImplTest : public testing::Test {};

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_OnlyAgeOver) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_OnlyAgeInYears) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeIntersitialType_OnlyAgeBirthYear) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeIntersitialType_OnlyBirthDate) {}

base::Value GenerateNonAgeOpenid4VpRequest() {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeIntersitialType_OnlyNonAgeDataElement) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_LowRiskOriginTakesPrecedenceOverRequestType) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_EmptyPathList) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_RequestMultiplePaths) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_NoPath) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_EmptyFieldsList) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_RequestMultipleAgeAssertions) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_RequestMultipleFields) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_NoConstraints) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_EmptyInputDescriptorList) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_RequestMultipleDocuments) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_NonMdlInputDescriptorId) {}

TEST_F(DigitalIdentityRequestImplTest,
       Openid4VpProtocol_ComputeInterstitialType_NoPresentationDefinition) {}

TEST_F(DigitalIdentityRequestImplTest,
       PreviewProtocol_ComputeInterstitialType_OnlyAgeOver) {}

TEST_F(DigitalIdentityRequestImplTest,
       PreviewProtocol_ComputeInterstitialType_OnlyAgeInYears) {}

TEST_F(DigitalIdentityRequestImplTest,
       PreviewProtocol_ComputeIntersitialType_OnlyAgeBirthYear) {}

TEST_F(DigitalIdentityRequestImplTest,
       PreviewProtocol_ComputeIntersitialType_OnlyBirthDate) {}

TEST_F(DigitalIdentityRequestImplTest,
       PreviewProtocol_ComputeIntersitialType_GivenName) {}

}  // namespace content