#include "components/browser_sync/sync_client_utils.h"
#include <string>
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/password_manager/core/browser/password_store/test_password_store.h"
#include "components/reading_list/core/dual_reading_list_model.h"
#include "components/reading_list/core/fake_reading_list_model_storage.h"
#include "components/reading_list/core/reading_list_model_impl.h"
#include "components/sync/base/features.h"
#include "components/sync/service/local_data_description.h"
#include "components/sync/test/mock_data_type_local_change_processor.h"
#include "components/sync_bookmarks/bookmark_model_view.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace browser_sync {
namespace {
password_manager::PasswordForm CreateTestPassword(
const std::string& url,
password_manager::PasswordForm::Store store =
password_manager::PasswordForm::Store::kProfileStore,
base::Time last_used_time = base::Time::UnixEpoch()) { … }
syncer::LocalDataDescription CreateLocalDataDescription(
syncer::DataType type,
int item_count,
const std::vector<std::string>& domains,
int domain_count) { … }
class LocalDataQueryHelperTest : public testing::Test { … };
TEST_F(LocalDataQueryHelperTest, ShouldHandleZeroTypes) { … }
TEST_F(LocalDataQueryHelperTest, ShouldHandleUnusableTypes) { … }
TEST_F(LocalDataQueryHelperTest, ShouldReturnLocalPasswordsViaCallback) { … }
TEST_F(LocalDataQueryHelperTest, ShouldReturnCountOfDistinctDomains) { … }
TEST_F(LocalDataQueryHelperTest, ShouldHandleMultipleRequests) { … }
TEST_F(LocalDataQueryHelperTest, ShouldReturnLocalBookmarksViaCallback) { … }
TEST_F(LocalDataQueryHelperTest, ShouldIgnoreManagedBookmarks) { … }
TEST_F(LocalDataQueryHelperTest,
ShouldOnlyTriggerCallbackWhenAllTypesHaveReturned) { … }
TEST_F(LocalDataQueryHelperTest,
ShouldHandleMultipleRequestsForDifferentTypes) { … }
TEST_F(LocalDataQueryHelperTest, ShouldReturnLocalReadingListViaCallback) { … }
TEST_F(LocalDataQueryHelperTest, ShouldWorkForUrlsWithNoTLD) { … }
class LocalDataMigrationHelperTest : public testing::Test { … };
TEST_F(LocalDataMigrationHelperTest, ShouldLogRequestsToHistogram) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldNotLogUnsupportedDataTypesRequestToHistogram) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldHandleZeroTypes) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldHandleUnusableTypes) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldMovePasswordsToAccountStore) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldNotUploadSamePassword) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldUploadConflictingPasswordIfMoreRecentlyUsed) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldNotUploadConflictingPasswordIfLessRecentlyUsed) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldUploadConflictingPasswordIfMoreRecentlyUpdated) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldNotUploadConflictingPasswordIfLessRecentlyUpdated) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldUploadConflictingPasswordIfMoreRecentlyCreated) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldNotUploadConflictingPasswordIfLessRecentlyCreated) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldMoveBookmarksToAccountStore) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldClearBookmarksFromLocalStore) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldDoNothingIfAccountBookmarksDontExist) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldIgnoreManagedBookmarks) { … }
TEST_F(LocalDataMigrationHelperTest,
ShouldHandleMultipleRequestsForDifferentTypes) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldHandleMultipleRequestsForPasswords) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldMoveReadingListToAccountStore) { … }
TEST_F(LocalDataMigrationHelperTest, ShouldClearReadingListFromLocalStore) { … }
}
}