chromium/components/autofill/core/browser/webdata/payments/autofill_wallet_credential_sync_bridge_unittest.cc

// Copyright 2023 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/autofill/core/browser/webdata/payments/autofill_wallet_credential_sync_bridge.h"

#include <stddef.h>

#include <memory>
#include <utility>

#include "base/strings/string_number_conversions.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/webdata/autofill_sync_metadata_table.h"
#include "components/autofill/core/browser/webdata/mock_autofill_webdata_backend.h"
#include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h"
#include "components/autofill/core/browser/webdata/payments/payments_sync_bridge_util.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/sync/base/data_type.h"
#include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/sync/model/data_type_activation_request.h"
#include "components/sync/protocol/autofill_specifics.pb.h"
#include "components/sync/protocol/autofill_wallet_credential_specifics.pb.h"
#include "components/sync/protocol/entity_data.h"
#include "components/sync/protocol/sync.pb.h"
#include "components/sync/test/mock_commit_queue.h"
#include "components/sync/test/mock_data_type_local_change_processor.h"
#include "components/webdata/common/web_database.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace autofill {

namespace {

AutofillWalletCredentialSpecifics;
DataTypeState;
EntityData;
MockDataTypeLocalChangeProcessor;
NiceMock;
Return;

std::vector<ServerCvc> ExtractServerCvcDataFromDataBatch(
    std::unique_ptr<syncer::DataBatch> batch) {}

}  // namespace

class AutofillWalletCredentialSyncBridgeTest : public testing::Test {};

TEST_F(AutofillWalletCredentialSyncBridgeTest, VerifyGetClientTag) {}

TEST_F(AutofillWalletCredentialSyncBridgeTest, VerifyGetStorageKey) {}

TEST_F(AutofillWalletCredentialSyncBridgeTest, IsEntityDataValid_ValidData) {}

TEST_F(AutofillWalletCredentialSyncBridgeTest, IsEntityDataValid_InValidData) {}

// Test to verify full merge sync for the server cvc data.
// There is no existing server cvc data on the local storage.
TEST_F(AutofillWalletCredentialSyncBridgeTest, MergeFullSyncData) {}

// Test to verify incremental sync to add a server cvc.
// A server cvc on the local storage is added via MergeFullSync and then
// incremental sync is called with new unique server cvc data.
TEST_F(AutofillWalletCredentialSyncBridgeTest,
       ApplyIncrementalSyncChanges_AddCvc) {}

// Test to verify incremental sync to delete a server cvc.
// A server cvc on the local storage is added via MergeFullSync and then
// incremental sync is called to delete the existing server cvc.
TEST_F(AutofillWalletCredentialSyncBridgeTest,
       ApplyIncrementalSyncChanges_DeleteCvc) {}

// Test to verify incremental sync to update a server cvc.
// A server cvc on the local storage is added via MergeFullSync and then
// incremental sync is called to update the existing server cvc.
TEST_F(AutofillWalletCredentialSyncBridgeTest,
       ApplyIncrementalSyncChanges_UpdateCvc) {}

// Test to verify addition changes in server cvc on the local database are being
// sent to the Chrome sync server.
TEST_F(AutofillWalletCredentialSyncBridgeTest, ServerCvcChanged_Add) {}

// Test to verify update changes in server cvc on the local database are being
// sent to the Chrome sync server.
TEST_F(AutofillWalletCredentialSyncBridgeTest, ServerCvcChanged_Update) {}

// Test to verify deletion changes in server cvc on the local database are being
// sent to the Chrome sync server.
TEST_F(AutofillWalletCredentialSyncBridgeTest, ServerCvcChanged_Remove) {}

// Test to verify all the server cvc data is deleted/cleared when the sync is
// disabled.
TEST_F(AutofillWalletCredentialSyncBridgeTest, ApplyDisableSyncChanges) {}

// Test to verify no deletion APIs are triggered in `ApplyDisableSyncChanges`
// when there is no server CVC data to delete.
TEST_F(AutofillWalletCredentialSyncBridgeTest,
       ApplyDisableSyncChanges_NoServerCvcPresent) {}

// Test to get all the server cvc data for a user which is filtered on the list
// of `instrument_id` provided.
TEST_F(AutofillWalletCredentialSyncBridgeTest, GetDataForCommit) {}

// Test to get all the server cvc data for a user while debugging.
TEST_F(AutofillWalletCredentialSyncBridgeTest, GetAllDataForDebugging) {}

// Test to verify the non deletion/updation of the server cvc for the card with
// the `UPDATE` change tag.
TEST_F(AutofillWalletCredentialSyncBridgeTest,
       DoesNotUpdateOrDeleteServerCvcWhenCardUpdated) {}

}  // namespace autofill