#include "components/consent_auditor/consent_sync_bridge_impl.h"
#include <map>
#include <set>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "components/sync/model/data_batch.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/user_consent_specifics.pb.h"
#include "components/sync/test/data_type_store_test_util.h"
#include "components/sync/test/mock_data_type_local_change_processor.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace consent_auditor {
namespace {
UserConsentSpecifics;
DataBatch;
DataTypeStore;
DataTypeStoreTestUtil;
DataTypeSyncBridge;
EntityChange;
EntityChangeList;
EntityData;
MetadataChangeList;
MockDataTypeLocalChangeProcessor;
OnceDataTypeStoreFactory;
_;
ElementsAre;
Eq;
InvokeWithoutArgs;
IsEmpty;
IsNull;
NotNull;
Pair;
Pointee;
Property;
Return;
SaveArg;
SizeIs;
UnorderedElementsAre;
WithArg;
WriteBatch;
MATCHER_P(MatchesUserConsent, expected, "") { … }
UserConsentSpecifics CreateSpecifics(int64_t client_consent_time_usec) { … }
std::unique_ptr<UserConsentSpecifics> SpecificsUniquePtr(
int64_t client_consent_time_usec) { … }
class ConsentSyncBridgeImplTest : public testing::Test { … };
TEST_F(ConsentSyncBridgeImplTest, ShouldCallModelReadyToSyncOnStartup) { … }
TEST_F(ConsentSyncBridgeImplTest, ShouldGetDataForCommit) { … }
TEST_F(ConsentSyncBridgeImplTest, ShouldRecordSingleConsent) { … }
TEST_F(ConsentSyncBridgeImplTest, ShouldNotDeleteConsentsWhenSyncIsDisabled) { … }
TEST_F(ConsentSyncBridgeImplTest,
ShouldRecordMultipleConsentsAndDeduplicateByTime) { … }
TEST_F(ConsentSyncBridgeImplTest,
ShouldDeleteCommitedConsentsAfterApplyIncrementalSyncChanges) { … }
TEST_F(ConsentSyncBridgeImplTest, ShouldRecordConsentsBeforeSyncEnabled) { … }
TEST_F(ConsentSyncBridgeImplTest,
ShouldSubmitBufferedConsentsWhenStoreIsInitialized) { … }
TEST_F(ConsentSyncBridgeImplTest,
ShouldReportPreviouslyPersistedConsentsWhenSyncIsReenabled) { … }
TEST_F(ConsentSyncBridgeImplTest,
ShouldReportPersistedConsentsOnStartupWithSyncAlreadyEnabled) { … }
TEST_F(ConsentSyncBridgeImplTest, ShouldReportPersistedConsentsOnSyncEnabled) { … }
TEST_F(ConsentSyncBridgeImplTest,
ShouldResubmitPersistedConsentOnlyIfSameAccount) { … }
}
}