#include "base/base64.h"
#include "base/memory/raw_ptr.h"
#include "build/build_config.h"
#include "chrome/browser/sync/test/integration/bookmarks_helper.h"
#include "chrome/browser/sync/test/integration/encryption_helper.h"
#include "chrome/browser/sync/test/integration/passwords_helper.h"
#include "chrome/browser/sync/test/integration/sync_engine_stopped_checker.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/sync/base/passphrase_enums.h"
#include "components/sync/engine/nigori/key_derivation_params.h"
#include "components/sync/engine/nigori/nigori.h"
#include "components/sync/nigori/cryptographer_impl.h"
#include "components/sync/service/sync_service_impl.h"
#include "components/sync/test/fake_server_nigori_helper.h"
#include "components/sync/test/nigori_test_utils.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_launcher.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace {
AddURL;
BookmarksTitleChecker;
CreateBookmarkServerEntity;
ServerBookmarksEqualityChecker;
FakeServer;
GetServerNigori;
SetNigoriInFakeServer;
NigoriSpecifics;
BuildCustomPassphraseNigoriSpecifics;
Cryptographer;
DataTypeSet;
GetEncryptedBookmarkEntitySpecifics;
InitCustomPassphraseCryptographerFromNigori;
KeyParamsForTesting;
LoopbackServerEntity;
PassphraseType;
Pbkdf2PassphraseKeyParamsForTesting;
ProtoPassphraseInt32ToEnum;
ScryptPassphraseKeyParamsForTesting;
SyncEngineStoppedChecker;
ElementsAre;
class CommittedBookmarkEntityNameObserver : public FakeServer::Observer { … };
class SingleClientCustomPassphraseSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
ShouldSetNewPassphraseAndCommitEncryptedData) { … }
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
ShouldDecryptPbkdf2KeyEncryptedData) { … }
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
ShouldEncryptDataWithPbkdf2Key) { … }
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
ShouldDecryptScryptKeyEncryptedData) { … }
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
ShouldEncryptDataWithScryptKey) { … }
#if !BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
PRE_CanDecryptWithKeystoreKeys) { … }
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
CanDecryptWithKeystoreKeys) { … }
#endif
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
DoesNotLeakUnencryptedData) { … }
IN_PROC_BROWSER_TEST_F(SingleClientCustomPassphraseSyncTest,
ReencryptsDataWhenPassphraseIsSet) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientCustomPassphraseSyncTest,
ShouldRestorePassphraseOnClientDataObsoleteResponseWhenPassphraseSetByDecryption) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientCustomPassphraseSyncTest,
ShouldRestorePassphraseOnClientDataObsoleteResponseWhenPassphraseSetByEncryption) { … }
}